ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Userfriendly interaction of tuples with mpl containers
by Daniel =?iso-8859-1?Q?Kr=FCgler?= (nee Spangenberg) other posts by this author
Jan 14 2004 3:12PM messages near this date
[boost] [serialization] Error handling underdocumented? | [boost] Re: Userfriendly interaction of tuples with mpl containers
Hi boosters,

I am just doing first steps in using the boost::mpl library, which is
really great.
Obviously due to my ignorance of knowing it not better, I tried the
following:

#include <boost/mpl/vector.hpp> 
#include <boost/mpl/size.hpp> 
#include <boost/mpl/void.hpp> 
#include <boost/tuple/tuple.hpp> 

template<
    typename T0 = boost::mpl::void_, typename T1 = boost::mpl::void_,
    typename T2 = boost::mpl::void_, typename T3 = boost::mpl::void_,
    typename T4 = boost::mpl::void_, typename T5 = boost::mpl::void_,
    typename T6 = boost::mpl::void_, typename T7 = boost::mpl::void_,
    typename T8 = boost::mpl::void_, typename T9 = boost::mpl::void_
    > 
class Test
{
    typedef boost::mpl::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> 
        InternalTypeContainer;

    typedef boost::tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> 
Tuples; // Fragile code!!
    Tuples m_Tuple;
};

typedef Test<double, char, bool>  MyTypes;

As you will belief, that will not compile successfully, because
boost::mpl::void_ is
an undefined type (similar to void) and I am trying to fill my tuple
partially with undefined
types. So my problem is:

Does there exist a boost::mpl way (?) to define my
boost::tuples::tuple<>  inside the given
Test class template until the last non-mpl::void_ is filled into it?
(Iteration until end??)

Or does their exist another tuple class, which I should try to use at
this place?

Shamefully I have to confess that I have to cope with the VC6 compiler
here....

Thank you very much for your ideas,

Daniel




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Daniel =?iso-8859-1?Q?Kr=FCgler?= (nee Spangenberg)
Daniel =?iso-8859-1?Q?Kr=FCgler?= (nee Spangenberg)
Aleksey Gurtovoy
Giovanni Bajo

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved