template and nested class problem

From: Miroslav Novak (miroslav.novak_at_is.cz)
Date: 10/31/03


Date: Fri, 31 Oct 2003 14:51:17 +0100

Hi,
I can't compile the following code. Does anyone know where is the problem?
Thank you in advance,
    Mirek.

code:
----------------

template<class T>
struct CA
{
    struct CB
    {
        T* z;
    };
};

template<class T>
void fun(typename CA<T>::CB x) {}; // line 56

void test()
{
    CA<int>::CB x;
    fun(x); // line 61
}

errors:
------------

test.cpp(61) : error C2783: 'void fun(CA<T>::CB)' : could not deduce
template argument for 'T'
test.cpp(56) : see declaration of 'fun'



Relevant Pages

  • Re: associative array, container, mapping, terminology
    ... |> is a pointer, I see that as a kind of type, but also specific to what it ... |> different kind of struct I consider to really be two different types. ... | but which kind isn't known at compile time, ... I'm looking at having a mapping that is homogenous keys and homogenous data, ...
    (comp.programming)
  • Re: Generating a simple hand-coded like recursive descent parser
    ... include compound words due to intrinsic functions. ... What do you mean by keyword combinations? ... "compile", directive on what compiler options will be used ... struct ASTNode { ...
    (comp.compilers)
  • Re: Need help in Including/converting C files in C++ project
    ... I never realized that I should set the "Compile As" ... > struct X ... > differs from X in the typedef. ... The name of the first struct is X in C++, ...
    (microsoft.public.vc.language)
  • Re: ANSI C Compilation linking problem
    ... I have the files group.h and group.c that use a struct define in logic.h and two fonctions define in logic.c. ... when the program compile, it is able to find the reference to the ... So the logic.o wasnt really compile and he forgot that it wasnt complete and still tryed to link it. ...
    (comp.lang.c)
  • Templates with constant array parameter
    ... How do I parameterize a template by a a allocated array of integers, ... which is declared static and constant, so I can make compile time ... struct IF{ ... static void exec { ...
    (comp.lang.cpp)