Problem with std::string::npos in CINT

From: Tobias Raufer <T.Raufer1_at_physics.ox.ac.uk>
Date: Wed, 20 Sep 2006 12:23:20 -0500


Hi RootTalk,

I am using version 5.11/02 built from source on a Suse 10 system.

I seem to have a problem when using STL strings in CINT. Consider the following short macro:

#include <iostream>
#include <string>

using namespace std;

void test() {

  string testString = "Hello";
  cout << "Find x: " << testString.find("x") << endl;   cout << "string::npos: " << string::npos << endl;

}

In interpreted mode this produces the following output:

root [0] .x test.C
Find x: 4294967295
string::npos: -1
root [1]

Is there a problem with string::npos in CINT? When I compile the same macro with ACliC, everything works fine.

Thank you very much.

        Tobi     Received on Wed Sep 20 2006 - 19:23:32 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET