Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-04-28 09:55:52

On 11/08/2001 10:18 AM, Aleksey Gurtovoy wrote:
> And the extensions themselves are here:

The test code in:


looks like the iterator, to be useful, requires some
templated function similar to the:

template<class Tuple> void foo(tuples::tuple_iterator<Tuple>) {}

in that file. However, the template argument, Tuple, provides no
clue to the programmer as to the argument type or which element
in the tuple is being passed. Wouldn't a variant argument be
more self-documenting? In addition, wouldn't some sort of
visitor also be more self-documenting. The visitor would take
the same argument as the tuple:


BTW, the zip file did not have tuple.hpp; hence, I'm guessing what
the appropriate nested type (type_list) for the tuple types
would be. Then visitor could be defined as follows:

   < typename HeadField
   , typename OtherFields
   < HeadField
   , OtherFields
   : public OtherFields
     visit_field( HeadField& a_field )

       ( void
       * Only to avoid compile error during parse of subclass'
       * using declaration.

}//exit visitors_detail namespace

#include <boost/mpl/inherit_linearly.hpp>

   < typename type_list
   : public boost::mpl::inherit_linearly
     < type_list
     , visited_fields
       , boost::mpl::arg<1>
     , empty_visited_field

Boost list run by bdawes at, gregod at, cpdaniel at, john at