Is STL-thinking over-emphasized in C++

  • Thread starter Steven T. Hatton
  • Start date
S

Steven T. Hatton

I've encountered some design concepts lately which provide useful features,
but probably won't conform to certain STL guarantees such as no-throws on
certain operations, or supporting all the copy construction, or iterator
requirements. I believe any kind of container that makes it's way into the
Standard is either going to completely conform, or come very close.
tr1::array<> comes to mind as an example which, I believe, does not conform
100% to STL container requirements.

I have the sense that many C++ programmers believe every container type
should conform to the STL requirements. Is that a realistic observation?
Is it a good idea? Could there be another set of specified requirement for
a collection of library containers that would address a different design
need, and still provide predictable, reliable behavior?
 
J

John Carson

Steven T. Hatton said:
I've encountered some design concepts lately which provide useful
features, but probably won't conform to certain STL guarantees such
as no-throws on certain operations, or supporting all the copy
construction, or iterator requirements. I believe any kind of
container that makes it's way into the Standard is either going to
completely conform, or come very close. tr1::array<> comes to mind as
an example which, I believe, does not conform 100% to STL container
requirements.

I have the sense that many C++ programmers believe every container
type should conform to the STL requirements. Is that a realistic
observation?

Well, stacks and queues don't satisfy the requirements. I haven't heard a
clamor to have them banned.
Is it a good idea? Could there be another set of
specified requirement for a collection of library containers that
would address a different design need, and still provide predictable,
reliable behavior?

Of course.
 
M

Maxim Yegorushkin

On Thu, 07 Jul 2005 10:56:44 +0400, John Carson

[]
Well, stacks and queues don't satisfy the requirements. I haven't heard
a clamor to have them banned.

Neither are they containers. Rather they are adapters.
 
J

John Carson

Maxim Yegorushkin said:
On Thu, 07 Jul 2005 10:56:44 +0400, John Carson

[]
Well, stacks and queues don't satisfy the requirements. I haven't
heard a clamor to have them banned.

Neither are they containers. Rather they are adapters.


They are not STL containers, they are STL adapters (by definition, nothing
can be a STL container if it doesn't satisfy the requirements for STL
containers). They are, however, containers in the generic sense.
 
P

Panjandrum

Steven said:
I have the sense that many C++ programmers believe every container type
should conform to the STL requirements. Is that a realistic observation?
Is it a good idea? Could there be another set of specified requirement for
a collection of library containers that would address a different design
need, and still provide predictable, reliable behavior?

Take a look at real-world C++ programs, eg. at http://sourceforge.net/
.. You'll find that STL-thinking is not over-emphasized in real C++
projects (quite contrary). It's just over-emphasized in C++ newsproups.
Firstly, because STLs enormous usability problems, secondly, because it
attracts many "gurus" who use STL as playground for their worldshaking
improvements.
 
R

Richard Herring

"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled
Take a look at real-world C++ programs, eg. at http://sourceforge.net/
. You'll find that STL-thinking is not over-emphasized in real C++
projects (quite contrary). It's just over-emphasized in C++ newsproups.
Firstly, because STLs enormous usability problems,

As they say:

Name 5.
secondly, because it
attracts many "gurus" who use STL as playground for their worldshaking
improvements.
Wouldn't know about that. Me, I just use STL containers to avoid
reinventing the wheel, because they offer well-documented performance
guarantees, and because I can reasonably assume they are well-tested,
stable and robust.
 
D

Dietmar Kuehl

Richard said:
"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled
As they say:

Name 5.

Don't bother: I asked about details about problems and/or their
cure before without getting any information back from the
Illuminated.
 
D

Dave Vandervies

"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled

As they say:

Name 5.

I'll start:
(1) You need to actually learn something before you can use it effectively


(Never mind that the same applies to the language in general, or any
other language or tool you care to name. Nobody else seems to care
about that little detail.)


dave
 
D

Dietmar Kuehl

Steven said:
I have the sense that many C++ programmers believe every container type
should conform to the STL requirements. Is that a realistic observation?

I hope not. After all, the container concepts are not that useful in the
first place, especially when it comes to specialized behavior. However,
it is likely that even specialized containers provide access using
appropriate sequence concepts (whether these are those which are
currently in the C++ standard or a future refinement thereof).
 
S

Stephen Howe

Take a look at real-world C++ programs, eg. at http://sourceforge.net/
. You'll find that STL-thinking is not over-emphasized in real C++
projects (quite contrary). It's just over-emphasized in C++ newsproups.
Firstly, because STLs enormous usability problems...

I have seen you claim this before. What usability problems?
And since you are not sold on the STL, what do you recommend as an
alternative and why?
Note, whatever you recommend, you will have to defend.
..., secondly, because it attracts many "gurus" who use STL as playground
for their worldshaking
improvements.

Well any improvements are a good thing.

Stephen Howe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top