473,378 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Is STL-thinking over-emphasized in C++

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?
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #1
9 1371
"Steven T. Hatton" <ch********@germania.sup> wrote in message
news:MK********************@speakeasy.net
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.

--
John Carson
Jul 23 '05 #2
On Thu, 07 Jul 2005 10:56:44 +0400, John Carson
<jc****************@netspace.net.au> wrote:

[]
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.


Neither are they containers. Rather they are adapters.

--
Maxim Yegorushkin
<fi****************@gmail.com>
Jul 23 '05 #3
"Maxim Yegorushkin" <fi****************@gmail.com> wrote in message
news:op***************@localhost.localdomain
On Thu, 07 Jul 2005 10:56:44 +0400, John Carson
<jc****************@netspace.net.au> wrote:

[]
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.


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.

--
John Carson

Jul 23 '05 #4
Steven T. Hatton wrote:
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.

Jul 23 '05 #5
"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled
Steven T. Hatton wrote:
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,


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.

--
Richard Herring
Jul 23 '05 #6
Richard Herring wrote:
"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.
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
Jul 23 '05 #7
In article <w6**************@baesystems.com>,
Richard Herring <ri*************@baesystems.com> wrote:
"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled

Firstly, because STLs enormous usability problems,


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

--
Dave Vandervies dj******@csclub.uwaterloo.ca
Actually I've had a really hard time not saying "Which one of us
is on crack today?", but I've been trying to be polite to people
today online. --Ben Pfaff in comp.lang.c
Jul 23 '05 #8
Steven T. Hatton wrote:
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).
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
Jul 23 '05 #9
> 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

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
by: Allan Bruce | last post by:
Hi there, I am interested to know if there are any C++ programmers who do not use STL. I have been coding in C++ for a year or so now, although only recently have I started a large(ish)-scale...
2
by: Jean-Baptiste | last post by:
Hi, I am currently porting a C++ project (linux version) under windows. This project uses the STL stuff. When I try to compile and built my project, I get a lot of errors. The main part of them...
2
by: Steve | last post by:
Just wondering if someone can point me to a good, easy to understand online tutorial on STL functions. All the programming manuals I have predate STL, and I would like to learn more about modern...
25
by: Norm Matloff | last post by:
Anyone have an answer--just a guess would do--as to what percentage of programmers who do their primary work in C++ make use of the STL? Norm Matloff
13
by: Alvin | last post by:
Correct me if I am wrong, but the STL standard only defines the interface only and not the implementation, right? For example, say I use a std::map. The speed and efficiency of the operator(key)...
11
by: RR | last post by:
I have Plauger's book on STL and I've found that it's different from the STL I have on a Linux box (libstdc++-2.96-112). In particular, the map::erase(iterator) method I have returns nothing...
0
by: Tony Johansson | last post by:
Hello! I have two classes called Handle which is a template class and a class Integer which is not a template class. The Integer class is just a wrapper class for a primitive int with some...
0
by: rajd99 | last post by:
Hi, I am getting the following error while compiling with sun C++ 5.5 and using SGI STL. Has anyone run into this. The SGI headers are one at http://www.sgi.com/tech/stl/download.html Thanks, ...
6
by: Bart Simpson | last post by:
I am writing a shared object (Dll in Windows) and I am making extensive use of the STL. I am getting lots of warnings like this: ClassA.h(139): warning C4251: 'ClassA::indexarray' : class...
9
by: OuaisBla | last post by:
Although STL container can't support object by reference as a template argument. To make thing worse, allocator can't support stack based allocation. So: std::deque<std::string const &> is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.