L
Lasse Skyum
I have my own string class that I'm generally verry fond of compared to
std::string. For that same reason I'm trying to improve a little on it.
Since manny objects in my project will contain strings of empty size "" I
thought it would be a good idea to share en empty string allocation between
all uninitialized strings.
However I have no idea where to place this constant? :-S
I tried this:
class CBL_String
{
public:
static char * strEmptyString = ""; // it complaines about this...
};
If I do don't initialize it in the class-spec but in a cpp file I'm not sure
that it is actually initialized before used, by some other global CBL_String
variable... right?
char *CBL_String::strEmptyString = "";
Suggestions anyone?
std::string. For that same reason I'm trying to improve a little on it.
Since manny objects in my project will contain strings of empty size "" I
thought it would be a good idea to share en empty string allocation between
all uninitialized strings.
However I have no idea where to place this constant? :-S
I tried this:
class CBL_String
{
public:
static char * strEmptyString = ""; // it complaines about this...
};
If I do don't initialize it in the class-spec but in a cpp file I'm not sure
that it is actually initialized before used, by some other global CBL_String
variable... right?
char *CBL_String::strEmptyString = "";
Suggestions anyone?