Originally posted by: roman
This is the reaction to irrelevant comments in the article, not to the relevant article contents.
Mister, what makes you say what is poor style and what is good style ? The macro definition with comment of "very poor style" has a syntax error in it anyway. What makes you believe macros are "poor style" comparing to typedef ? What makes it such ? Bad performance, easy compilation errors, difficult debugging, what ?
Reply
Originally posted by: CBasicNet
Nice job, Gabriel!
I just spent the night reading the article. I think I will read it again during this weekend. However, I have a question, regarding the Allocator class.
Let's say I have a class called CBasicNet and I want to use the vector to store it, so this Allocator class is to be provided by my own class, CBasicNet ?
ReplyOriginally posted by: NIceguy
this is very good !!!
ReplyOriginally posted by: willchop
Nice article, but was wondering the significance of the
clear() call in the "Swapping Contents" section. Do we
really need this call?
regards, willchop
Originally posted by: Neal Stublen
A very nice introduction to the vector template! I just started using STL myself and your article offers a great explanation of vectors.
I look forward to future articles.
Originally posted by: Ramon Fabregat
Very Good Gabriel,
Very usefull to teach and learn, these "esoteric" features named templates.
Thanks a lot to share these particular approach.
Waitting next tutorial. :)
Originally posted by: Jiř� �oler
The one reason of use of higher programing language is siplicity of work with more complicated data types and structures. Clasical programing languages defined only small set of internal types and structures, so programmer has been forced to use them. On the other hand, C++ language open programmers the possibility of creation of their own types and structures - good tool for work, but also good toy for trick lovers.
Every coin has two sides. On one hand, the clasical languages limited programmers fantasy, on the other hand those limited tools resulted in the natural program unification and transferability.
When appeared C++, it gave programmers more tools for tricks, but minimal standard tools for work with natural types and structures like strings and/or dynamic arrays. As a consequence, there occured wide spread programmers folklore of varous such tools - in fact each programmer or programmer group use their own implementation of strings, arrays, lists ... . Including, say, MFC CString, CArray, CMap, OLE types as BSTR, COleVariant etc. It supported programmer creativity, but threaten standartization and program transferability. The problem has been solved by STL library, but rather too late.
It is well, when programming language has open posibility of creating types and structures made to measure. On the other hand, the good idea is standartisation of types and structures suited for normal daily work and use the specific tailored types and structures only where it is necessary. For this reason, the use of STL structures is recomended, but it came too late, so old folklore overcome for long time.
ReplyOriginally posted by: Benjamin
Thank you :-)
Reply
Originally posted by: Per Nilsson
Nice intro to stl. Even though it is part of the standard I sometimes get the feeling that ppl don't realise this and are even afraid to use it and if not reinventing the wheel use the less-generic equivalents of for example MFC instead.
I always find it great to find articles encouraging use of stl and boost(*). And an article keeping it simple as this
one is just super.
(*)www.boost.org. Some parts of boost are going to be part of the stl in the next version (whenever that is released).
Originally posted by: Paul Bouche
I do note the following issue from one of
// following statements are equivalent:
A nice introduction to vectors.
the examples in the tutorial --
int j = v.back();
int j = v[v.size()]; <=== should be v.size()-1
int j = v.at(v.size()); <=== same
int j = *(v.end()-1);