J
Jarek Blakarz
Hi
Consider the following program:
const char *str = "my name";
std::string s(str);
std::string allocates the new memory on a heap.
I would like to force the std::string to initially work directly on a string
pointed to by "const char *str" and not allocate anything on a heap.
Of course later on when writing to a string occurs the COW is allowed.
Can I do that ? If so, HOW ?
thanks for answer
Consider the following program:
const char *str = "my name";
std::string s(str);
std::string allocates the new memory on a heap.
I would like to force the std::string to initially work directly on a string
pointed to by "const char *str" and not allocate anything on a heap.
Of course later on when writing to a string occurs the COW is allowed.
Can I do that ? If so, HOW ?
thanks for answer