template inside a tempate
It there any difference between, for example
1 2 3
|
template </*something*/>
template</*something else*/>
/* your function or class that uses those templates*/
|
and
1 2
|
template </*something*/, /*something else*/>
/* your function or class that uses those templates*/
|
except that the latter is nicer and easyer to use?
If by your first method you mean something like this
1 2 3 4 5 6
|
template <typename T>
template <typename W>
void function_abc( T t, W w)
{
}
|
then that is an error
So it is not the same as this (which is ok)
1 2 3 4 5
|
template <typename T, typename W>
void function_abc( T t, W w)
{
}
|
or the same as this which is also ok (two template list for two different things)
1 2 3 4 5 6 7 8 9 10 11 12 13
|
template <typename T>
struct AStruct
{
template <typename W>
void AStructTemplateFunction( W w);
};
template <typename T>
template <typename W>
void AStruct <T>::AStructTemplateFunction( W w)
{
}
|
Last edited on
Topic archived. No new replies allowed.