Re: c++0x: member template fails with a strange error (4.5.1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Edward PieÅkowski <edek.pienkowski@xxxxxxxxx> writes:

> template <class T>    // THIS LINE ADDED
> class BB {
>     std::shared_ptr<AA> a_ptr;
> public:
>     void something () {
>        this->a_ptr->doSomething<CC> (); // FAILS
>        a_ptr->doSomething<CC> ();       // OK
>        AA().doSomething<CC> ();         // OK
>     }
> };

This is the rather obscure case where you need to use a template
qualifier.  You need it to tell the parser that you are referring to a
member template within a template function.  You need to write
    this->a_ptr->template doSomething<CC> ();

Ian



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux