Boost logo

Boost Users :

From: Seweryn Habdank-Wojewódzki (habdank_at_[hidden])
Date: 2006-12-16 07:37:33


Hi

I working with tuples, and that tuples are constructed by K elements. For me
interesting are 1-st, 2-nd and 3-rd.
0-th and others not.

Inside my procedure I want to know what are the types on the positions 1, 2,
3. How can I get them?

The example:

somewhere in the code:

typedef tuple < std::string, double, double, double, int, std::string > Foo;
typedef tuple < std::string, long double, long double, long double, long ,
std::map<int,std::string> > Bar;

My part:

template < typename Tuple >
// somethink like: typename Tuple::get_type<1>
calculate ( Tuple & t )
{
  // here I need for some calculations know what are the types
  // on the positions 1,2,3?
};

And proposition of usage:

calculate ( /*Foo*/ foo );
calculate ( /*Bar*/ bar );

Best regards,

-- 
|\/\/|   Seweryn Habdank-Wojewódzki
`\/\/'

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net