#include #include // This simple example of std::string usage crashes ROOT: // // root [0] .x test_string.C // // *** Break *** segmentation violation // Root > Function test_string() busy flag cleared namespace { void print( const string& string ) { cout << "print using a std::string: " << string << endl; } void print( const char* string ) { cout << "print using a const char*: " << string << endl; } } void test_string( const string& my_string = "Hello, world." ) { print( my_string ); print( my_string.c_str() ); } #ifndef __CINT__ int main( int argc, char* argv[] ) { test_string(); return 0; } #endif // __CINT__ // Local variables: // compile-command: "g++ `root-config --cflags` -Wall test_string.C -o test_string" // End: