3 string types : Allocator( )

1
2
3
4
5
6
The string class defines several constructors and many functions. Here are three 
commonly used constructors:
string(const Allocator &alloc = Allocator( ) )
string(const char *str, const Allocator &alloc = Allocator( ) )
string(const string &str, size_type start_idx = 0, size_type num = npos, 
            const Allocator &alloc = Allocator( ) )


May I know more about Allocator type ???

and what is this way of assignment and declaration ?

string(const Allocator &alloc = Allocator( ) )

Thanks
Here is an article about Allocator:

http://www.codeproject.com/KB/cpp/allocator.aspx

You can create your own, and pass it to the string constructor (or many STL containers) if you wish.
Topic archived. No new replies allowed.