Templated typedefs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Juha Nieminen

    #1

    Templated typedefs

    Apparently something like this is not currently possible:

    template<typena me T>
    typedef bool(*VectComp) (const std::vector<T>& , const std::vector<T>& );

    void foo(VectComp<in t>);

    template<typena me T>
    void bar(VectComp<T> );

    Will this be possible in the next C++ standard?
  • Michael DOUBEZ

    #2
    Re: Templated typedefs

    Juha Nieminen a écrit :
    Apparently something like this is not currently possible:
    >
    template<typena me T>
    typedef bool(*VectComp) (const std::vector<T>& , const std::vector<T>& );
    No. template oftypedef are not allowed.
    Current usage is:

    template<typena me T>
    struct VectComp
    {
    typedef bool(*type)(con st std::vector<T>& , const std::vector<T>& );
    };

    >
    void foo(VectComp<in t>);
    void foo(VectComp<in t>::type);
    >
    template<typena me T>
    void bar(VectComp<T> );
    template<typena me T>
    void bar(typename VectComp<T>::ty pe);
    >
    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

    Comment

    Working...