I think you'll want to look info boost fusion library for this. Since you are working with heterogneous types, you'll probably need use a template function to express what you want to do. Boost Phoenix should also help you to create a  polymorphic functor to apply to each element of the tuple.


Le lun. 6 juil. 2015 08:51, Gavin Lambert <gavinl@compacsort.com> a écrit :
On 6/07/2015 18:23, Uthpal Urubail wrote:
> Experts,
> What is the best way to iterator over boost::tuple and return value?
> Example:
>       For(int i=0;i<boost::tuples::length<T>::value;i++)
>       {
>               Boost_tuple_example.get<i>();
>       }

I think you'll need to explain more about why you're trying to do that.

Tuples are typically related data of heterogeneous types, so it
typically doesn't make sense (and nor is it possible without a common
base class or type erasure) to return components individually in that
sort of generic fashion.  Unless I'm just misinterpreting your example.


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users