|
Boost Users : |
Subject: Re: [Boost-users] [tuple] Tuple arithmetic
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-02-10 05:05:09
Philipp Moeller <philipp.moeller_at_[hidden]> writes:
> template<class T, class F>
> inline void for_each(boost::tuples::cons<T, boost::tuples::null_type>
> const& tuple, F f)
> {
> f(tuple.get_head());
> }
>
> template<class T, class U, class F>
> inline void for_each(boost::tuples::cons<T, U> const& tuple, F f)
> {
> f(tuple.get_head());
> for_each(tuple.get_tail(), f);
> }
Proper attribution is missing. I took the code from this message on the
boost mailing list http://lists.boost.org/Archives/boost/2004/09/72919.php
-- Philipp Moeller
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