diff options
Diffstat (limited to 'boost/fusion/adapted/boost_array/detail')
8 files changed, 284 insertions, 0 deletions
diff --git a/boost/fusion/adapted/boost_array/detail/at_impl.hpp b/boost/fusion/adapted/boost_array/detail/at_impl.hpp new file mode 100644 index 0000000000..6df8858663 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/at_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_AT_IMPL_27122005_1241) +#define BOOST_FUSION_AT_IMPL_27122005_1241 + +#include <boost/type_traits/is_const.hpp> + +#include <boost/mpl/if.hpp> + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template<typename T> + struct at_impl; + + template<> + struct at_impl<boost_array_tag> + { + template<typename Sequence, typename N> + struct apply + { + typedef typename mpl::if_< + is_const<Sequence>, + typename Sequence::const_reference, + typename Sequence::reference>::type type; + + static type + call(Sequence& seq) + { + return seq[N::value]; + } + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/begin_impl.hpp b/boost/fusion/adapted/boost_array/detail/begin_impl.hpp new file mode 100644 index 0000000000..c8bce9ffe7 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/begin_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_BEGIN_IMPL_27122005_1117) +#define BOOST_FUSION_BEGIN_IMPL_27122005_1117 + +#include <boost/fusion/adapted/boost_array/array_iterator.hpp> + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template<typename T> + struct begin_impl; + + template <> + struct begin_impl<boost_array_tag> + { + template <typename Sequence> + struct apply + { + typedef array_iterator<Sequence, 0> type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/category_of_impl.hpp b/boost/fusion/adapted/boost_array/detail/category_of_impl.hpp new file mode 100644 index 0000000000..8e92efd7c3 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/category_of_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_CATEGORY_OF_IMPL_27122005_1044) +#define BOOST_FUSION_CATEGORY_OF_IMPL_27122005_1044 + +#include <boost/config/no_tr1/utility.hpp> + +namespace boost { namespace fusion { + + struct boost_array_tag; + struct random_access_traversal_tag; + + namespace extension + { + template<typename T> + struct category_of_impl; + + template<> + struct category_of_impl<boost_array_tag> + { + template<typename T> + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/end_impl.hpp b/boost/fusion/adapted/boost_array/detail/end_impl.hpp new file mode 100644 index 0000000000..38b5a82cb4 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_END_IMPL_27122005_1120) +#define BOOST_FUSION_END_IMPL_27122005_1120 + +#include <boost/fusion/adapted/boost_array/array_iterator.hpp> + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template <typename Tag> + struct end_impl; + + template <> + struct end_impl<boost_array_tag> + { + template <typename Sequence> + struct apply + { + typedef array_iterator<Sequence, Sequence::static_size> type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp b/boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp new file mode 100644 index 0000000000..cdbe6c8382 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_SEQUENCE_IMPL_27122005_1648) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1648 + +#include <boost/mpl/bool.hpp> + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template<typename Tag> + struct is_sequence_impl; + + template<> + struct is_sequence_impl<boost_array_tag> + { + template<typename Sequence> + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/is_view_impl.hpp b/boost/fusion/adapted/boost_array/detail/is_view_impl.hpp new file mode 100644 index 0000000000..cf63c6a667 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_VIEW_IMPL_27042006_2221) +#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2221 + +#include <boost/mpl/bool.hpp> + +namespace boost { namespace fusion +{ + struct boost_array_tag; + + namespace extension + { + template<typename Tag> + struct is_view_impl; + + template<> + struct is_view_impl<boost_array_tag> + { + template<typename T> + struct apply : mpl::false_ + {}; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/size_impl.hpp b/boost/fusion/adapted/boost_array/detail/size_impl.hpp new file mode 100644 index 0000000000..c04ab93c6c --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/size_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_SIZE_IMPL_27122005_1251) +#define BOOST_FUSION_SIZE_IMPL_27122005_1251 + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template<typename T> + struct size_impl; + + template<> + struct size_impl<boost_array_tag> + { + template<typename Sequence> + struct apply : mpl::int_<Sequence::static_size> {}; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/boost_array/detail/value_at_impl.hpp b/boost/fusion/adapted/boost_array/detail/value_at_impl.hpp new file mode 100644 index 0000000000..9f80f73b39 --- /dev/null +++ b/boost/fusion/adapted/boost_array/detail/value_at_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under 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_VALUE_AT_IMPL_27122005_1256) +#define BOOST_FUSION_VALUE_AT_IMPL_27122005_1256 + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template<typename T> + struct value_at_impl; + + template <> + struct value_at_impl<boost_array_tag> + { + template <typename Sequence, typename N> + struct apply + { + typedef typename Sequence::value_type type; + }; + }; + } +}} + +#endif |