Symbol numeric_limits is not defined

---------------hello.C------------
#include // for I/O
#include // for file I/O
using namespace std;

void hello()
{
ifstream file("/dev/null");
//skip next line of file
file.ignore(numeric_limits::max(),’\n’);
cout << “hello world” << endl;
}
---------------hello.C------------

result of root -b -q hello.C
Error: Symbol numeric_limits is not defined in current scope FILE:hello.C LINE:10
Error: Symbol int is not defined in current scope FILE:hello.C LINE:10

however, root -b -q hello.C+ is ok.

I am sorry if this question should be posted in CINT.

Hi,

I guess when you call cint with a c++ file (hello.c+) it loads all the c++ features and standard libraries so numeric_limits is available. If you do not so only the standard c stuff is loaded and so no numeric_limits are available.

Just a guess,

Mathias

The interpreter knows only a very small subset of the infinity of possible
templated classes. It does not know the class numeric_limits.
The compiler is able to instantiate this template.
Always use ACLIC when using templates.

Rene

thanks a lot!