July 26, 2002
here is one more:

template<class T>
struct A
{
  A()
  { }

  A(const A<T> &a)
  { }

  template<class U>
  A(const A<U> &a)
  // Error: 'A<char >::A<char >' is already defined
  { }
};


template <class U, class V>
class P
  : public V
{
 public:
  P(const V &v)
    : V(v)
  { }
};


template<class T, class U>
struct B
{
 public:
  U g()
  { return U(P<T, U>(U())); }
};


int main()
{
  B<char, A<char> > b;
  b.g();

  return 0;
}


bye, Christof

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

...and what have you contributed to the Net?
July 27, 2002
I guess this one shouldn't compile, but it currently does:

struct A
{
  static const int c = 42;

  struct B
  { };
};


int main(int argc)
{
  return A::B::c;
}


bye, Christof

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

...and what have you contributed to the Net?