[Boost.MPL] mpl::find<Types, T> not allowed in with T as template<typename T> argument?

Hi, I have a short question. ----------- typedef boost::mpl::vector<double, int> Types; template<typename T> void send(){ typedef boost::mpl::find<Types, T>::type iter_T; //Doesn't compile typedef boost::mpl::find<Types, int>::type iter_T_static; //Compiles } ------------ I want the first cersion with my own Template Type. But the compiler gives me somthing like "Not enough Template arguments". (My Compiler outputs me german error messages...) Am i not allowed using my own template arguments with boost::mpl::find? Or what do i have to change? Thanks! Manuel Jung

Manuel Jung wrote:
typedef boost::mpl::find<Types, T>::type iter_T; //Doesn't compile
The 'typename' keyword is missing in this case. Try typedef typename boost::mpl::find<Types, T>::type iter_T;
typedef boost::mpl::find<Types, int>::type iter_T_static; //Compiles
Non-templatized context here, so works without. Regards, Tobias

Ahhh Thanks! Now it does compile! :-) Greetings Manuel Jung Tobias Schwinger wrote:
Manuel Jung wrote:
typedef boost::mpl::find<Types, T>::type iter_T; //Doesn't compile
The 'typename' keyword is missing in this case. Try
typedef typename boost::mpl::find<Types, T>::type iter_T;
typedef boost::mpl::find<Types, int>::type iter_T_static; //Compiles
Non-templatized context here, so works without.
Regards, Tobias
participants (2)
-
Manuel Jung
-
Tobias Schwinger