ODR safe code

[SVN r35275]
This commit is contained in:
Joel de Guzman
2006-09-22 13:39:27 +00:00
parent da23c8a4cc
commit a37b435ce6
22 changed files with 269 additions and 21 deletions

View File

@ -19,6 +19,9 @@
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
@ -38,6 +41,15 @@ namespace boost { namespace fusion
BOOST_MPL_ASSERT_NOT((is_same<category, random_access_traversal_tag>));
};
};
template <>
struct advance_impl<array_iterator_tag>;
template <>
struct advance_impl<mpl_iterator_tag>;
template <>
struct advance_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -13,6 +13,10 @@
namespace boost { namespace fusion
{
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
template <typename Tag>
@ -21,6 +25,15 @@ namespace boost { namespace fusion
template <typename Iterator>
struct apply {};
};
template <>
struct deref_impl<array_iterator_tag>;
template <>
struct deref_impl<mpl_iterator_tag>;
template <>
struct deref_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -20,6 +20,9 @@
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
@ -36,6 +39,15 @@ namespace boost { namespace fusion
BOOST_MPL_ASSERT_NOT((is_same<first_category, random_access_traversal_tag>));
};
};
template <>
struct distance_impl<array_iterator_tag>;
template <>
struct distance_impl<mpl_iterator_tag>;
template <>
struct distance_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -17,6 +17,10 @@
namespace boost { namespace fusion
{
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
template <typename Tag>
@ -28,6 +32,15 @@ namespace boost { namespace fusion
: is_same<typename add_const<I1>::type, typename add_const<I2>::type>
{};
};
template <>
struct equal_to_impl<array_iterator_tag>;
template <>
struct equal_to_impl<mpl_iterator_tag>;
template <>
struct equal_to_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -12,6 +12,10 @@
namespace boost { namespace fusion
{
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
template <typename Tag>
@ -20,6 +24,15 @@ namespace boost { namespace fusion
template <typename Iterator>
struct apply {};
};
template <>
struct next_impl<array_iterator_tag>;
template <>
struct next_impl<mpl_iterator_tag>;
template <>
struct next_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -12,6 +12,10 @@
namespace boost { namespace fusion
{
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
template <typename Tag>
@ -20,6 +24,15 @@ namespace boost { namespace fusion
template <typename Iterator>
struct apply {};
};
template <>
struct prior_impl<array_iterator_tag>;
template <>
struct prior_impl<mpl_iterator_tag>;
template <>
struct prior_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -13,6 +13,10 @@
namespace boost { namespace fusion
{
struct array_iterator_tag; // boost::array iterator tag
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
namespace extension
{
template <typename Tag>
@ -21,6 +25,15 @@ namespace boost { namespace fusion
template <typename Iterator>
struct apply {};
};
template <>
struct value_of_impl<array_iterator_tag>;
template <>
struct value_of_impl<mpl_iterator_tag>;
template <>
struct value_of_impl<std_pair_iterator_tag>;
}
namespace result_of

View File

@ -15,6 +15,10 @@
namespace boost { namespace fusion
{
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
template <typename Tag>
@ -23,6 +27,15 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply;
};
template <>
struct at_impl<array_tag>;
template <>
struct at_impl<mpl_sequence_tag>;
template <>
struct at_impl<std_pair_tag>;
}
namespace result_of

View File

@ -15,6 +15,10 @@
namespace boost { namespace fusion
{
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
template <typename Tag>
@ -23,6 +27,15 @@ namespace boost { namespace fusion
template <typename Sequence, typename Key>
struct apply;
};
template <>
struct at_key_impl<array_tag>;
template <>
struct at_key_impl<mpl_sequence_tag>;
template <>
struct at_key_impl<std_pair_tag>;
}
namespace result_of

View File

@ -13,6 +13,9 @@
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
@ -22,6 +25,15 @@ namespace boost { namespace fusion
template <typename Sequence>
struct apply;
};
template <>
struct begin_impl<array_tag>;
template <>
struct begin_impl<mpl_sequence_tag>;
template <>
struct begin_impl<std_pair_tag>;
}
namespace result_of

View File

@ -15,6 +15,7 @@
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
struct mpl_sequence_tag; // mpl sequence tag
namespace extension
{
@ -26,6 +27,9 @@ namespace boost { namespace fusion
: mpl::bool_<(result_of::size<Sequence>::value == 0)>
{};
};
template <>
struct empty_impl<mpl_sequence_tag>;
}
namespace result_of

View File

@ -13,6 +13,9 @@
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
@ -22,6 +25,15 @@ namespace boost { namespace fusion
template <typename Sequence>
struct apply;
};
template <>
struct end_impl<array_tag>;
template <>
struct end_impl<mpl_sequence_tag>;
template <>
struct end_impl<std_pair_tag>;
}
namespace result_of

View File

@ -16,6 +16,9 @@ namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
@ -28,6 +31,15 @@ namespace boost { namespace fusion
template meta_at_impl<Key>::type, void_> >
{};
};
template <>
struct has_key_impl<array_tag>;
template <>
struct has_key_impl<mpl_sequence_tag>;
template <>
struct has_key_impl<std_pair_tag>;
}
namespace result_of

View File

@ -23,6 +23,15 @@ namespace boost { namespace fusion
template <typename Sequence>
struct apply : Sequence::size {};
};
template <>
struct size_impl<array_tag>;
template <>
struct size_impl<mpl_sequence_tag>;
template <>
struct size_impl<std_pair_tag>;
}
namespace result_of

View File

@ -13,6 +13,10 @@
namespace boost { namespace fusion
{
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
template <typename Tag>
@ -21,6 +25,15 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply;
};
template <>
struct value_at_impl<array_tag>;
template <>
struct value_at_impl<mpl_sequence_tag>;
template <>
struct value_at_impl<std_pair_tag>;
}
namespace result_of

View File

@ -14,6 +14,10 @@
namespace boost { namespace fusion
{
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
template <typename Tag>
@ -22,6 +26,15 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply;
};
template <>
struct value_at_key_impl<array_tag>;
template <>
struct value_at_key_impl<mpl_sequence_tag>;
template <>
struct value_at_key_impl<std_pair_tag>;
}
namespace result_of

View File

@ -14,6 +14,10 @@
namespace boost { namespace fusion
{
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
template<typename Tag>
@ -24,6 +28,15 @@ namespace boost { namespace fusion
: detail::fusion_category_of<T>
{};
};
template <>
struct category_of_impl<array_tag>;
template <>
struct category_of_impl<mpl_sequence_tag>;
template <>
struct category_of_impl<std_pair_tag>;
}
namespace traits

View File

@ -12,16 +12,15 @@
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/tag_of.hpp>
namespace boost { namespace fusion {
namespace boost { namespace fusion
{
namespace extension
{
template<typename Tag>
struct is_associative_impl
{
template<typename Seq>
struct apply
: mpl::false_
{};
struct apply : mpl::false_ {};
};
}
@ -29,8 +28,10 @@ namespace boost { namespace fusion {
{
template <typename Seq>
struct is_associative
: extension::is_associative_impl<typename detail::tag_of<Seq>::type>::template apply<Seq>
: extension::is_associative_impl<typename detail::tag_of<Seq>::type>::
template apply<Seq>
{};
}}}
}
}}
#endif

View File

@ -18,6 +18,9 @@
namespace boost { namespace fusion
{
struct non_fusion_tag;
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
@ -37,13 +40,23 @@ namespace boost { namespace fusion
template<typename T>
struct apply : mpl::false_ {};
};
template <>
struct is_sequence_impl<array_tag>;
template <>
struct is_sequence_impl<mpl_sequence_tag>;
template <>
struct is_sequence_impl<std_pair_tag>;
}
namespace traits
{
template <typename T>
struct is_sequence
: extension::is_sequence_impl<typename detail::tag_of<T>::type>::template apply<T>
: extension::is_sequence_impl<typename detail::tag_of<T>::type>::
template apply<T>
{};
}
}}

View File

@ -13,6 +13,10 @@
namespace boost { namespace fusion
{
struct array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag
namespace extension
{
template<typename Tag>
@ -23,6 +27,15 @@ namespace boost { namespace fusion
: detail::fusion_is_view<T>
{};
};
template <>
struct is_view_impl<array_tag>;
template <>
struct is_view_impl<mpl_sequence_tag>;
template <>
struct is_view_impl<std_pair_tag>;
}
namespace traits
@ -32,6 +45,7 @@ namespace boost { namespace fusion
extension::is_view_impl<typename detail::tag_of<T>::type>::
template apply<T>::type
{};
}}}
}
}}
#endif

View File

@ -10,8 +10,16 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <boost/fusion/support/detail/is_mpl_sequence.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/utility/enable_if.hpp>
#include <utility>
namespace boost
{
template <typename T, std::size_t N>
class array; // forward
}
namespace boost { namespace fusion
{
@ -35,6 +43,15 @@ namespace boost { namespace fusion
{
typedef typename Sequence::fusion_tag type;
};
template <typename T, std::size_t N>
struct tag_of<boost::array<T, N> >;
template <typename Sequence>
struct tag_of<Sequence, typename boost::enable_if<detail::is_mpl_sequence<Sequence> >::type>;
template<typename T1, typename T2>
struct tag_of<std::pair<T1, T2> >;
}
namespace detail