------- Comment #3 from ylalym at gmail dot com  2009-10-04 15:33 -------
(In reply to comment #0)
There is a makeshift.

File a.cpp
#include <stdio.h>

const class nullptr_t
{
public:
  template<class T> operator T*() const { return 0; }
  template<class C, class T> operator T C::*() const { return 0; }

  // void (C::*pmf)() = nullptr;        // Ok
  // if (nullptr == pmf) {}             // Ok
  template<class C, class T> bool operator == (C (T::*p)()) const
    { return  p == 0; }

  private:
    void operator&() const;

    // const int n = 0;
    // if (nullptr == n) {}             // Error
    bool operator == (long) const;
}
nullptr = {};

struct C
{
  void func();
};

int main(void)
{
  void (C::*pmf)() = nullptr;
  if (nullptr == pmf) {printf("Ok\n");}

  // If there are sentences - send !!!!!!!!
  // if (pmf == nullptr) {printf("Ok\n");} // Error
}

> g++ a.cpp
> ./a.out
Ok
>


-- 

ylalym at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ylalym at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33990

Reply via email to