Original Post
What syntax is required to do this (or if it is possible)?
' used as a declarator
main.cpp:26: error: no matching function for call to `foo::foo()'
main.cpp:11: error: candidates are: foo::foo(const foo&)
[edited by - duke on May 18, 2004 12:52:50 PM]
[edited by - duke on May 18, 2004 12:53:39 PM]
template<class T>
struct foo
{
template<class G>
foo()
{
G g;
}
T t;
};
then to instantiate it:
foo<int> f<float>;
Gcc 3.3.3 gives an error.
What I am trying to do is call a constructor in a templated class that has a template constructor which requires explicit specification of the template constructor argument.
So really, can this be done, and if so what is the syntax... and btw my example is just to illustrate, that is not exactly what I am trying to do.
Actual error msg:
main.cpp: In function `int main()':
main.cpp:26: error: template-id `f