Re: ISO standards
Jeffrey Baker ha scritto:
Why hasn't ISO seen it needed to change the vector library to one that is i
easy to use like the string library?
Please define "easy".
With <string> using std:::string; I can create string objects like "string
st, str;" and work from within the class implementation. The vector libray
should be the same. Yes, objects are created and they are in the friendship
form of OOP outside the class where global scope objects are created and
used. This make implementation more difficult for the beginner of vectors
and is a greater abstraction from C style OPP.
I'm sorry, but I really can't understand a single sentence. Could you
please rephrase possibly including a code snippet that shows the
difference you see between string and vector?
I mean, the only difference between string and vector is that vector
requires a template parameter, for example:
#include <string>
#include <vector>
// global scope
std::string s;
std::vector<int> v;
class C
{
// class scope
std::string s;
std::vector<int> v;
};
the template parameter is required because you there's no reasonable
default parameter type for vectors, while char is a reasonable default
for string.
Regards,
Ganesh
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]