Boost logo

Boost :

From: Russell Hind (rh_gmane_at_[hidden])
Date: 2005-05-05 14:17:03


Jason Hise wrote:
>
> The previous line makes me worry that CRTP will not work on your
> compiler. CRTP is a major foundation for the library, so if it doesn't
> work it may not be possible to find a work around. Does the following
> compile?
>
> template < typename Type >
> struct Base
> {
> Type * ptr;
> };
>
> struct Derived : public Base < Derived >
> {
> };
>

Yes, this compiles fine.

>
> These might be the result of some compiler problem with friends inside
> templated classes. See if this compiles:
>
> template < typename Type >
> class Outer
> {
> private:
> typedef Type some_type;
>
> class Inner
> {
> typename Outer < Type >::some_type inner;
> } inner;
>
> friend class Inner;
> };
>
> int main ( )
> {
> Outer < int > test;
> return 0;
> }
>

This also compiles fine.

Thanks

Russell


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk