www.digitalmars.com         C & C++   DMDScript  

c++.beta - typedef: member function pointer of template class

reply Christof Meerwald <cmeerw web.de> writes:
template<class T>
struct A
{
  void f()
  { }
};

int main()
{
  typedef void (A<int >::* member)();
  // Error: '=', ';' or ',' expected
}


Extracted from Boost's concept_check library.


bye, Christof

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

...and what have you contributed to the Net?
Jun 15 2003
parent Christof Meerwald <cmeerw web.de> writes:
template<class T>
struct A
{
  typedef T * (A<T>::*f) () const;
  typedef T * (A::*g) () const;
  // Error: 'A' must be a class name preceding '::'
};


int main()
{
  A<int> a;
}


I guess both typedefs should be accepted. Extracted from Boost's smart_ptr
library.


bye, Christof

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

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