>> I think that it has to do with trouble building boost on other platforms with the compilers we have.
I don't think you need to build boost to use its scoped_array.
Printable View
>> I think that it has to do with trouble building boost on other platforms with the compilers we have.
I don't think you need to build boost to use its scoped_array.
Are you sure if was allocated with new?
I've seen C++ code where they tried to "optimize" it by using malloc() & free() for intrinsic data types and only use new & delete for classes.
I strongly disagree with C++ code that uses malloc() & free(), but unfortunately there's some of it out there.
This sort of attitude is hilarious. The compiler takes C++ code and turns it into machine language. To most programmers, this is a mysterious, almost magical process. The programmer is happy to accept that this magic "just happens" but simultaneously assumes that the compiler is so stupid that using new[] on a built-in type is somehow going to be less efficient than malloc().
It's like putting infinite trust in something and at the same time implicitly distrusting it. It's a sign that the programmer has no clue what's actually happening, at ANY level.
hm, maybe you could use an std::string before rerereinventing the somewhat-squared wheel . What uses has a smart pointer to a char array that a string can not handle ?