luceneplusplus/LucenePlusPlus — pull request #24 by rowanj (2011-10-09 13:27:05+00:00)
Title: Use std::string and std::wstring

Referring to my posts on the Google Groups mailing lists, here's the patch to make the Lucene::String types a bit more compatible with at least our project under Xcode 4.2, and save some of the repeated construction and c_str()'ing.

I should note that std::string (and std::wstring, and anything else that derives from std::basic_string<*>) is implemented as a ref-counted copy-on-write wrapper internally for nearly all C++ standard library implementations - meaning that having the host code repeatedly getting the (w)char* from the .c_str() function and constructing a new object is going to be a lot more expensive with *any* allocator, especially when dealing with stack-allocated temporaries.

--- commit message ---
The custom allocator specifications otherwise make Lucene::String and Lucene::SingleString incompatible with common string types used by a host program; forcing repeated reconstruction via constructing one type with the .c_str() of the other.

The custom allocator was disabled by default, a thin wrapper around malloc/free.

Non-standard types need non-standard support in debuggers; an especially painful problem with current versions of Xcode 4.2, which seem to have broken custom debug data formatters.