better namespace discipline, ftag removal

[SVN r35435]
This commit is contained in:
Dan Marsden
2006-10-01 15:47:17 +00:00
parent 3f27fbe969
commit dbb2975df8
23 changed files with 158 additions and 120 deletions

View File

@ -10,6 +10,7 @@
#define BOOST_FUSION_EXAMPLE_STRUCT_ITERATOR
#include <boost/fusion/support/iterator_base.hpp>
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <boost/mpl/int.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/static_assert.hpp>
@ -22,26 +23,43 @@
#include "./detail/value_of_impl.hpp"
#include "./detail/equal_to_impl.hpp"
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
struct random_access_traversal_tag;
template<typename Struct, int Pos>
struct example_struct_iterator;
}
namespace boost { namespace fusion {
struct random_access_traversal_tag;
namespace traits
{
template<typename Struct, int Pos>
struct tag_of<example::example_struct_iterator<Struct, Pos> >
{
typedef example::example_struct_iterator_tag type;
};
}
}}
namespace example {
template<typename Struct, int Pos>
struct example_struct_iterator
: iterator_base<example_struct_iterator<Struct, Pos> >
: boost::fusion::iterator_base<example_struct_iterator<Struct, Pos> >
{
BOOST_STATIC_ASSERT(Pos >=0 && Pos < 3);
typedef Struct struct_type;
typedef mpl::int_<Pos> index;
typedef example_struct_iterator_tag fusion_tag;
typedef random_access_traversal_tag category;
typedef boost::mpl::int_<Pos> index;
typedef boost::fusion::random_access_traversal_tag category;
example_struct_iterator(Struct& str)
: struct_(str) {}
Struct& struct_;
};
}}
}
#endif