Defining a member-function of partially specialized template

Discussion in 'C++' started by Igor R., Jun 1, 2011.

  1. Igor R.

    Igor R. Guest

    Hello,

    Given the following partially specialized template, what would be the
    syntax of my_func() definition (out of class)?


    tempate<typename T, class Enable = void>
    {};

    template<typename T>
    struct my_class<some_wrapper<T>, typename
    enable_if<some_cond<some_wrapper<T> > >::type>
    {
    my_func();
    };


    Thanks!
    Igor R., Jun 1, 2011
    #1
    1. Advertising

  2. Igor R.

    Igor R. Guest

    > tempate<typename T, class Enable = void>
    > {};


    Sorry, I meant:

    template<typename T, class Enable = void>
    struct my_class
    {};
    Igor R., Jun 1, 2011
    #2
    1. Advertising

  3. Igor R.

    Igor R. Guest

    Sorry for the noise. For the above trivial example, the
    straightforward syntax seems to compile well:

    template<typename T>
    my_class<some_wrapper<T>, typename enable_if<some_cond<some_wrapper<T>
    > >::type>::my_func()

    {}

    I just overly simplified my real code, where I had some syntax error.
    Igor R., Jun 1, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Allan Schwartz
    Replies:
    1
    Views:
    385
    Victor Bazarov
    Aug 9, 2004
  2. Martin Magnusson
    Replies:
    1
    Views:
    371
    Rob Williscroft
    Nov 23, 2004
  3. BigMan
    Replies:
    3
    Views:
    1,416
    BigMan
    Apr 22, 2005
  4. Replies:
    1
    Views:
    467
    Victor Bazarov
    Jul 20, 2005
  5. er
    Replies:
    4
    Views:
    517
Loading...

Share This Page