Most likely you forgot -std = C ++ 0x. My MQL version of gcc version is 4.6.1 / 4.7.1, both support nulpt well.
As described in the "C ++ Standard Library, Tutorial and Reference, 2nd", nullptr is a keyword that can automatically convert to every pointer type, but not an integer type, this eliminates the NULL flaw, which is ambiguous for the next overload function : void f (int); void f (void *);
F (NULL); // Ambiguous F (nullptr); // OK
Testing this feature in VC2010 shows that the MSDN document conflicts with the actual compiler, the document said:
The nullptr keyword is not a type and is not supported for use with:
Sizeof
Typeid
throw nullptr
In fact, in VC2010, all of the above statements / expressions are legal. sizeof (nullptr) 4. typeid.name () result std :: nullptr_t, and throw nullptr can be detected by "const void *" and "void *" (and other types of pointers).
While gcc (4.7.1) looks tougher with respect to nullptr, throw nullptr cannot be captured by "void *", it can be detected by "..."
zhaorufei Jun 28 '12 at 7:13 2012-06-28 07:13
source share