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

@ -9,12 +9,15 @@
#if !defined(BOOST_FUSION_ADVANCE_IMPL_20060222_2150)
#define BOOST_FUSION_ADVANCE_IMPL_20060222_2150
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
template<typename Struct, int Pos>
struct example_struct_iterator;
}
namespace boost { namespace fusion {
namespace extension
{
@ -22,14 +25,14 @@ namespace boost { namespace fusion {
struct advance_impl;
template<>
struct advance_impl<example_struct_iterator_tag>
struct advance_impl<example::example_struct_iterator_tag>
{
template<typename Iterator, typename N>
struct apply
{
typedef typename Iterator::struct_type struct_type;
typedef typename Iterator::index index;
typedef example_struct_iterator<
typedef example::example_struct_iterator<
struct_type, index::value + N::value> type;
static type

View File

@ -14,9 +14,12 @@
#include <boost/mpl/int.hpp>
#include <boost/type_traits/is_const.hpp>
namespace boost { namespace fusion {
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -24,7 +27,7 @@ namespace boost { namespace fusion {
struct at_impl;
template<>
struct at_impl<example_sequence_tag>
struct at_impl<example::example_sequence_tag>
{
template<typename Sequence, typename Key>
struct apply;

View File

@ -19,9 +19,12 @@ namespace fields
struct age;
}
namespace boost { namespace fusion {
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -29,7 +32,7 @@ namespace boost { namespace fusion {
struct at_key_impl;
template<>
struct at_key_impl<example_sequence_tag>
struct at_key_impl<example::example_sequence_tag>
{
template<typename Sequence, typename Key>
struct apply;

View File

@ -11,22 +11,25 @@
#include "../example_struct_iterator.hpp"
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
struct example_sequence_tag;
namespace extension
{
template<typename Tag>
struct begin_impl;
template<>
struct begin_impl<example_sequence_tag>
struct begin_impl<example::example_sequence_tag>
{
template<typename Sequence>
struct apply
{
typedef example_struct_iterator<Sequence, 0> type;
typedef example::example_struct_iterator<Sequence, 0> type;
static type
call(Sequence& seq)

View File

@ -9,22 +9,24 @@
#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_20060223_2037)
#define BOOST_FUSION_CATEGORY_OF_IMPL_20060223_2037
namespace boost { namespace fusion {
#include <boost/fusion/support/category_of.hpp>
struct random_access_traversal_tag;
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
template<typename Tag>
struct category_of_impl;
template<>
struct category_of_impl<example_sequence_tag>
struct category_of_impl<example::example_sequence_tag>
{
template<typename Sequence>
struct apply
{
typedef random_access_traversal_tag type;
struct type : random_access_traversal_tag, associative_sequence_tag {};
};
};
}

View File

@ -15,12 +15,15 @@
#include <string>
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
template<typename Struct, int Pos>
struct example_struct_iterator;
}
namespace boost { namespace fusion {
namespace extension
{
@ -28,32 +31,32 @@ namespace boost { namespace fusion {
struct deref_impl;
template<>
struct deref_impl<example_struct_iterator_tag>
struct deref_impl<example::example_struct_iterator_tag>
{
template<typename Iterator>
struct apply;
template<typename Struct>
struct apply<example_struct_iterator<Struct, 0> >
struct apply<example::example_struct_iterator<Struct, 0> >
{
typedef typename mpl::if_<
is_const<Struct>, std::string const&, std::string&>::type type;
static type
call(example_struct_iterator<Struct, 0> const& it)
call(example::example_struct_iterator<Struct, 0> const& it)
{
return it.struct_.name;
}
};
template<typename Struct>
struct apply<example_struct_iterator<Struct, 1> >
struct apply<example::example_struct_iterator<Struct, 1> >
{
typedef typename mpl::if_<
is_const<Struct>, int const&, int&>::type type;
static type
call(example_struct_iterator<Struct, 1> const& it)
call(example::example_struct_iterator<Struct, 1> const& it)
{
return it.struct_.age;
}

View File

@ -11,9 +11,12 @@
#include <boost/mpl/minus.hpp>
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -21,7 +24,7 @@ namespace boost { namespace fusion {
struct distance_impl;
template<>
struct distance_impl<example_struct_iterator_tag>
struct distance_impl<example::example_struct_iterator_tag>
{
template<typename First, typename Last>
struct apply

View File

@ -11,22 +11,25 @@
#include "../example_struct_iterator.hpp"
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
struct example_sequence_tag;
namespace extension
{
template<typename Tag>
struct end_impl;
template<>
struct end_impl<example_sequence_tag>
struct end_impl<example::example_sequence_tag>
{
template<typename Sequence>
struct apply
{
typedef example_struct_iterator<Sequence, 2> type;
typedef example::example_struct_iterator<Sequence, 2> type;
static type
call(Sequence& seq)

View File

@ -11,9 +11,12 @@
#include <boost/mpl/equal_to.hpp>
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -21,7 +24,7 @@ namespace boost { namespace fusion {
struct equal_to_impl;
template<>
struct equal_to_impl<example_struct_iterator_tag>
struct equal_to_impl<example::example_struct_iterator_tag>
{
template<typename It1, typename It2>
struct apply

View File

@ -18,9 +18,12 @@ namespace fields
struct age;
}
namespace boost { namespace fusion {
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -28,7 +31,7 @@ namespace boost { namespace fusion {
struct has_key_impl;
template<>
struct has_key_impl<example_sequence_tag>
struct has_key_impl<example::example_sequence_tag>
{
template<typename Sequence, typename Key>
struct apply

View File

@ -1,34 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_IS_ASSOCIATIVE_IMPL_20060304_2324)
#define BOOST_FUSION_IS_ASSOCIATIVE_IMPL_20060304_2324
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion {
struct example_sequence_tag;
namespace extension
{
template<typename Tag>
struct is_associative_impl;
template<>
struct is_associative_impl<example_sequence_tag>
{
template<typename Seq>
struct apply
: mpl::true_
{};
};
}
}}
#endif

View File

@ -11,17 +11,20 @@
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion
{
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<example_sequence_tag>
struct is_sequence_impl<example::example_sequence_tag>
{
template<typename T>
struct apply : mpl::true_ {};

View File

@ -11,17 +11,20 @@
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion
{
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<example_sequence_tag>
struct is_view_impl<example::example_sequence_tag>
: boost::mpl::false_
{};
}

View File

@ -9,12 +9,15 @@
#if !defined(BOOST_FUSION_NEXT_IMPL_20060222_1859)
#define BOOST_FUSION_NEXT_IMPL_20060222_1859
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
template<typename Struct, int Pos>
struct example_struct_iterator;
}
namespace boost { namespace fusion {
namespace extension
{
@ -22,14 +25,14 @@ namespace boost { namespace fusion {
struct next_impl;
template<>
struct next_impl<example_struct_iterator_tag>
struct next_impl<example::example_struct_iterator_tag>
{
template<typename Iterator>
struct apply
{
typedef typename Iterator::struct_type struct_type;
typedef typename Iterator::index index;
typedef example_struct_iterator<struct_type, index::value + 1> type;
typedef example::example_struct_iterator<struct_type, index::value + 1> type;
static type
call(Iterator const& i)

View File

@ -9,12 +9,15 @@
#if !defined(BOOST_FUSION_PRIOR_IMPL_20060222_1944)
#define BOOST_FUSION_PRIOR_IMPL_20060222_1944
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
template<typename Struct, int Pos>
struct example_struct_iterator;
}
namespace boost { namespace fusion {
namespace extension
{
@ -22,14 +25,14 @@ namespace boost { namespace fusion {
struct prior_impl;
template<>
struct prior_impl<example_struct_iterator_tag>
struct prior_impl<example::example_struct_iterator_tag>
{
template<typename Iterator>
struct apply
{
typedef typename Iterator::struct_type struct_type;
typedef typename Iterator::index index;
typedef example_struct_iterator<struct_type, index::value - 1> type;
typedef example::example_struct_iterator<struct_type, index::value - 1> type;
static type
call(Iterator const& i)

View File

@ -11,9 +11,12 @@
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion {
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -21,7 +24,7 @@ namespace boost { namespace fusion {
struct size_impl;
template<>
struct size_impl<example_sequence_tag>
struct size_impl<example::example_sequence_tag>
{
template<typename Sequence>
struct apply

View File

@ -9,9 +9,12 @@
#if !defined(BOOST_FUSION_VALUE_AT_IMPL_20060223_2025)
#define BOOST_FUSION_VALUE_AT_IMPL_20060223_2025
namespace boost { namespace fusion {
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -19,7 +22,7 @@ namespace boost { namespace fusion {
struct value_at_impl;
template<>
struct value_at_impl<example_sequence_tag>
struct value_at_impl<example::example_sequence_tag>
{
template<typename Sequence, typename N>
struct apply;

View File

@ -15,9 +15,12 @@ namespace fields
struct age;
}
namespace boost { namespace fusion {
namespace example
{
struct example_sequence_tag;
}
namespace boost { namespace fusion {
namespace extension
{
@ -25,7 +28,7 @@ namespace boost { namespace fusion {
struct value_at_key_impl;
template<>
struct value_at_key_impl<example_sequence_tag>
struct value_at_key_impl<example::example_sequence_tag>
{
template<typename Sequence, typename N>
struct apply;

View File

@ -11,12 +11,15 @@
#include <string>
namespace boost { namespace fusion {
namespace example
{
struct example_struct_iterator_tag;
template<typename Struct, int Pos>
struct example_struct_iterator;
}
namespace boost { namespace fusion {
namespace extension
{
@ -24,23 +27,22 @@ namespace boost { namespace fusion {
struct value_of_impl;
template<>
struct value_of_impl<example_struct_iterator_tag>
struct value_of_impl<example::example_struct_iterator_tag>
{
template<typename Iterator>
struct apply;
template<typename Struct>
struct apply<example_struct_iterator<Struct, 0> >
struct apply<example::example_struct_iterator<Struct, 0> >
{
typedef std::string type;
};
template<typename Struct>
struct apply<example_struct_iterator<Struct, 1> >
struct apply<example::example_struct_iterator<Struct, 1> >
{
typedef int type;
};
};
}
}}