In principle, this template class is as follows:
template< class Value > class Holder { };
I would like to know the type of Value for this class Holder . I thought I could make a simple metafound that takes a templated template argument, for example:
template< template< class Value > class Holder > class GetValue { typedef Value Value; };
And then extract the value type as follows:
GetValue< Holder< int > >::Value value;
But instead, I just get an error message indicating a metafunction declaration:
error: 'Value' does not name a type
Is there any way to achieve this kind of thing? Thanks.
[EDIT] I also get error messages:
error: type/value mismatch at argument 1 in template parameter list for 'template<template<class Value> class Holder> class GetValue' error: expected a class template, got 'Holder<int>'
This leads me to conclude that Phil Nash is right, you cannot pass a class as an argument to a template template.
source share