diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 12:57:26 -0700 |
commit | 1a78a62555be32868418fe52f8e330c9d0f95d5a (patch) | |
tree | d3765a80e7d3b9640ec2e930743630cd6b9fce2b /boost/fusion/adapted/std_tuple/detail | |
download | boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2 boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip |
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'boost/fusion/adapted/std_tuple/detail')
8 files changed, 292 insertions, 0 deletions
diff --git a/boost/fusion/adapted/std_tuple/detail/at_impl.hpp b/boost/fusion/adapted/std_tuple/detail/at_impl.hpp new file mode 100644 index 0000000000..2f09719ca7 --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/at_impl.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_AT_IMPL_09242011_1744 + +#include <tuple> +#include <utility> +#include <boost/mpl/eval_if.hpp> +#include <boost/fusion/support/detail/access.hpp> +#include <boost/type_traits/remove_const.hpp> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename T> + struct at_impl; + + template <> + struct at_impl<std_tuple_tag> + { + template <typename Sequence, typename N> + struct apply + { + typedef typename remove_const<Sequence>::type seq_type; + typedef std::tuple_element<N::value, seq_type> element; + + typedef typename + mpl::eval_if< + is_const<Sequence> + , fusion::detail::cref_result<element> + , fusion::detail::ref_result<element> + >::type + type; + + static type + call(Sequence& seq) + { + return std::get<N::value>(seq); + } + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp b/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp new file mode 100644 index 0000000000..8b219024b8 --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_BEGIN_IMPL_09242011_1744 + +#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename T> + struct begin_impl; + + template <> + struct begin_impl<std_tuple_tag> + { + template <typename Sequence> + struct apply + { + typedef std_tuple_iterator<Sequence, 0> type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp b/boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp new file mode 100644 index 0000000000..96d567d5e9 --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09272006_0726) +#define BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726 + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + struct random_access_traversal_tag; + + namespace extension + { + template<typename T> + struct category_of_impl; + + template<> + struct category_of_impl<std_tuple_tag> + { + template<typename T> + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/end_impl.hpp b/boost/fusion/adapted/std_tuple/detail/end_impl.hpp new file mode 100644 index 0000000000..78782b7943 --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/end_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_END_IMPL_09242011_1744 + +#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp> +#include <boost/type_traits/remove_const.hpp> +#include <tuple> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename T> + struct end_impl; + + template <> + struct end_impl<std_tuple_tag> + { + template <typename Sequence> + struct apply + { + typedef typename remove_const<Sequence>::type seq_type; + static int const size = std::tuple_size<seq_type>::value; + typedef std_tuple_iterator<Sequence, size> type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/is_sequence_impl.hpp b/boost/fusion/adapted/std_tuple/detail/is_sequence_impl.hpp new file mode 100644 index 0000000000..6da5bdc34d --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/is_sequence_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_09242011_1744 + +#include <boost/mpl/bool.hpp> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename Tag> + struct is_sequence_impl; + + template<> + struct is_sequence_impl<std_tuple_tag> + { + template<typename Sequence> + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/is_view_impl.hpp b/boost/fusion/adapted/std_tuple/detail/is_view_impl.hpp new file mode 100644 index 0000000000..9439431b5a --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/is_view_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_IS_VIEW_IMPL_09242011_1744 + +#include <boost/mpl/bool.hpp> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename Tag> + struct is_view_impl; + + template<> + struct is_view_impl<std_tuple_tag> + { + template<typename T> + struct apply : mpl::false_ {}; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/size_impl.hpp b/boost/fusion/adapted/std_tuple/detail/size_impl.hpp new file mode 100644 index 0000000000..d8b10af1ef --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/size_impl.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_SIZE_IMPL_09242011_1744 + +#include <tuple> +#include <boost/mpl/int.hpp> +#include <boost/type_traits/remove_const.hpp> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename T> + struct size_impl; + + template <> + struct size_impl<std_tuple_tag> + { + template <typename Sequence> + struct apply : + mpl::int_<std::tuple_size< + typename remove_const<Sequence>::type>::value + > + {}; + }; + } +}} + +#endif diff --git a/boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp b/boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp new file mode 100644 index 0000000000..fa9656e7b2 --- /dev/null +++ b/boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + 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_09242011_1744) +#define BOOST_FUSION_VALUE_AT_IMPL_09242011_1744 + +#include <tuple> + +namespace boost { namespace fusion +{ + struct std_tuple_tag; + + namespace extension + { + template<typename T> + struct value_at_impl; + + template <> + struct value_at_impl<std_tuple_tag> + { + template <typename Sequence, typename N> + struct apply : std::tuple_element<N::value, Sequence> {}; + }; + } +}} + +#endif |