Re: Inheritance and friendship
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_monster.email-scan.com-16778-1376003188-0001
Content-Type: text/plain; format=flowed; delsp=yes; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Edoardo Tagome writes:
---- MaGoTest.hpp BEGIN ----
template <class T>
class Base
{
public:
static void Build()
{
new T() ;
}
} ;
template <class T>
class Der : public Base< T >
{
public:
static void Build()
{
Base<T>::Build() ;
}
} ;
class A : public Der< A >
{
template <class T> friend class Base ;
template <class T> friend class Der ;
This bug appears to be rather subtle.
Inside the scope of class A, 'Base' appears to resolve to the instantiated
Base template in the superclass.
Change this to:
template <class T> friend class ::Base ;
template <class T> friend class ::Der ;
And this should compile.
Dunno which compiler is wrong, here. Too esoteric for my taste.
--=_monster.email-scan.com-16778-1376003188-0001
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
iEYEABECAAYFAlIEJHQACgkQx9p3GYHlUOItmACfSUCh81zYonC1YZ+0+PPwcGQP
nJYAnRhgOZK98HyTXdNHZrSt4uN4qfxk
=CEmO
-----END PGP SIGNATURE-----
--=_monster.email-scan.com-16778-1376003188-0001--