Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Defining a member-function of partially specialized template

Reply
Thread Tools

Defining a member-function of partially specialized template

 
 
Igor R.
Guest
Posts: n/a
 
      06-01-2011
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!
 
Reply With Quote
 
 
 
 
Igor R.
Guest
Posts: n/a
 
      06-01-2011
> tempate<typename T, class Enable = void>
> {};


Sorry, I meant:

template<typename T, class Enable = void>
struct my_class
{};
 
Reply With Quote
 
 
 
 
Igor R.
Guest
Posts: n/a
 
      06-01-2011
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
partially specialized friend er C++ 4 03-23-2008 05:00 AM
Out-of-class definition of a non-template member of an explicitly specialized class template? BigMan C++ 3 04-22-2005 06:28 AM
template template argument from specialized instance gao_bolin@voila.fr C++ 0 03-29-2005 05:36 PM
Pointers to partially specialized template methods, type confusion Martin Magnusson C++ 1 11-23-2004 10:08 AM
function non-template versus fully specialized function template Robert Allan Schwartz C++ 1 08-09-2004 03:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57