>>I guess im not important enough to listen to. size_type does not have anything to do with string so its in its own seperate namespace so just put using std::size_type.
I don't think so...
Here is part of the basic_string class (i cut out some parts):
Code:
class basic_string
{
private:
struct Rep {
size_t len, res, ref;
bool selfish;
charT* data () { return reinterpret_cast<charT *>(this + 1); }
charT& operator[] (size_t s) { return data () [s]; }
charT* grab () { if (selfish) return clone (); ++ref; return data (); }
//...
inline static void * operator new (size_t, size_t);
inline static void operator delete (void *);
inline static Rep* create (size_t);
charT* clone ();
inline void copy (size_t, const charT *, size_t);
inline void move (size_t, const charT *, size_t);
inline void set (size_t, const charT, size_t);
inline static bool excess_slop (size_t, size_t);
inline static size_t frob_size (size_t);
private:
Rep &operator= (const Rep &);
};
public:
// types:
typedef traits traits_type;
typedef typename traits::char_type value_type;
typedef Allocator allocator_type;
typedef size_t size_type;
//...
};
As you can see, size_type is a typedef inside the std::basic_string class (and the std::string class is probably a typedef of the basic_string class)
So you have to use scope resolution to specify that something is part of a class, structure or namespace