Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Partial special...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 9406 of 10094
Post > Topic >>

Partial specialization on nested template types

by Kimon Hoffmann <kimon.hoffmann@[EMAIL PROTECTED] > Mar 20, 2008 at 06:50 PM

Hello all,

I currently have the problem that I want to partially specialize a 
traits class for custom template types that are nested within another 
template. Here is a small example illustrating what I'm trying to do:

----------------------------------------------------------------------

template<typename T> struct some_traits;

template<typename U>
struct Wrapper {

     template<typename V>
     struct Nested {
         // ...
     };

};

template<typename U, typename V>
struct some_traits<typename Wrapper<U>::template Nested<V> > {
     // ...
     // Traits definition
     // ...
};

----------------------------------------------------------------------

When instantiating the some_traits template with a specialization of 
Wrapper::Nested the compiler (GCC in this case) fails to match it to the 
partial specialization and instantiates the primary template instead.

Is there any way to make this work as expected?

Best regards,
   Kimon

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 3 Posts in Topic:
Partial specialization on nested template types
Kimon Hoffmann <kimon.  2008-03-20 18:50:26 
Re: Partial specialization on nested template types
Oncaphillis <oncaphill  2008-03-21 20:42:29 
Re: Partial specialization on nested template types
Kimon Hoffmann <kimon.  2008-03-22 09:43:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 18:25:26 CDT 2008.