Template in template calling static function

Hi all
I am trying to call a static function of a templated class TCA from an inner class contained itself in TCA.

Can you hellp me with that?
I have always this error
Code.cpp: In member function

Comments

  • I know how to fix the compilation error. I just don't know why it happens. Remove the "TCA::" before calling TPrint.

    The friend statment is unnecessary. GFD can access TCA member already.

    I could give a silly explanation why this code does not compile. Since GFD is declared inside TCA, appending TCA:: to the class just state the obvious. So, we fall to semantic rules applied on the syntax. BUT, you could perform this: TCA:;TPrint();, for example, which is valid. However is that what you really want? Seems a design issue.

    : Hi all
    : I am trying to call a static function of a templated class TCA from
    : an inner class contained itself in TCA.
    :
    : Can you hellp me with that?
    : I have always this error
    : Code.cpp: In member function
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion