Hi,
I haven't found any discussion of this issue; it's possible I've just
missed it. Anyway, the short form is that I'm trying to partially
specialize a class for tuple types. I specialize for cons
On Thursday 20 March 2003 01:50 pm, Bryan Silverthorn wrote:
So: I need a way to determine if a particular type is a tuple type, which would allow me to do the following:
template
class FooIf {}; template<class T> class Foo : public FooIf {}; template<class T> class FooIf { /* tuple implementation */ }; template<class T> class FooIf { /* non-tuple implementation */ }; AFAICT, there's no way to do so at present. I'd like to suggest a way to add this functionality: have cons<> (or tuple<>) inherit from a blank "tuple_base" class. This would let us use boost::is_base_and_derived to provide the is_tuple_type functionality for the code block above.
You can determine if a type T is a cons<...> or has a cons<...> base with:
namespace boost { namespace tuples {
template
participants (2)
-
Bryan Silverthorn
-
Douglas Gregor