7

Can anyone tell me what this means?

(::Type*)0

actually it is part of this

return (is_modifytype()) ?
u.myfunction : (::Type*)0; 
Billal Ouali
  • 77
  • 1
  • 5

1 Answers1

16

It means "cast the integer 0 (using a C-style cast) to the type Trip* (Trip pointer) found in the global namespace (::)".

It should just use nullptr - as in

return is_modifyCurrentTrip() ?
    u.modifyCurrentTrip : nullptr; 

Note: using :: explicitly to designate the global namespace prevents the compiler from prepending any namespace names itself - this is completely irrelevant when just using nullptr though.

Jesper Juhl
  • 30,449
  • 3
  • 47
  • 70