www.digitalmars.com         C & C++   DMDScript  

c++.rtl - std::type_info: minor standards compliance issue

#include <typeinfo>

typedef const char * (std::type_info::*func)() const;

int main()
  const std::type_info &ti = typeid(int);

  func f = &std::type_info::name;

  return 0;

In my opinion, this should compile with a standards compliant compiler, but
DM complains:

  func f = &std::type_info::name;
Error: need explicit cast to convert
from: char const *( std::type_info::*C func)()const 
to  : char const *( std::type_info::*member func)()const 

bye, Christof

http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Jun 05 2003