Boost logo

Boost Users :

Subject: Re: [Boost-users] iterator over boost::tuple
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2015-07-06 02:51:01


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 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