Juha Nieminen a écrit :
> Apparently something like this is not currently possible:
>
> template<typename T>
> typedef bool(*VectComp)(const std::vector<T>&, const std::vector<T>&);
No. template oftypedef are not allowed.
Current usage is:
template<typename T>
struct VectComp
{
typedef bool(*type)(const std::vector<T>&, const std::vector<T>&);
};
>
> void foo(VectComp<int>);
void foo(VectComp<int>::type);
>
> template<typename T>
> void bar(VectComp<T>);
template<typename T>
void bar(typename VectComp<T>::type);
>
> Will this be possible in the next C++ standard?
AFAIK not under this form, it will use aliasing.
See:
http://www.artima.com/cppsource/cpp0x.html
Michael