MCPcopy Create free account
hub / github.com/0voice/cpp_new_features / main

Function main

cpp_11/002_grammar_nullptr.cpp:41–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#define nullptr __get_nullptr_t()
40
41int main(int argc, char *argv[])
42{
43 char *pch = nullptr; // ok, __get_nullptr_t() => nullptr_t::nullptr_t(0) => template <class _Tp> nullptr_t::operator _Tp* () const
44 int *pint = nullptr; // ok, __get_nullptr_t() => nullptr_t::nullptr_t(0) => template <class _Tp> nullptr_t::operator _Tp* () const
45 bool b = nullptr; // ok, __get_nullptr_t() => nullptr_t::nullptr_t(0) => nullptr_t::operator int __nat::*() const
46 //int n = nullptr; // error: cannot convert 'myname::nullptr_t' to 'int' in initialization
47 int Test::*p = nullptr; // ok, __get_nullptr_t() => nullptr_t::nullptr_t(0) => template <class _Tp, class _Up> operator _Tp _Up::* () const
48 void (Test::*pfn)(int, char) = nullptr; // ok, __get_nullptr_t() => nullptr_t::nullptr_t(0) => template <class _Tp, class _Up> operator _Tp _Up::* () const
49 return 0;
50}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected