Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56278 - sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple
From: mr.chr.schmidt_at_[hidden]
Date: 2009-09-17 14:59:26


Author: cschmidt
Date: 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
New Revision: 56278
URL: http://svn.boost.org/trac/boost/changeset/56278

Log:
adapted std::(tr1::)tuple - impl
Added:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/at_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/begin_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/category_of_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/deref_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/end_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/is_sequence_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/is_view_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/size_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/tag_of.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/value_at_impl.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/value_of_impl.hpp (contents, props changed)

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/at_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/at_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,41 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_AT_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_AT_IMPL_HPP
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct at_impl;
+
+ template <>
+ struct at_impl<boost_tuple_tag>
+ {
+ template <typename Seq, typename N>
+ struct apply
+ {
+ typedef typename
+ detail::forward_as<
+ Seq
+ , typename tuples::element<
+ N::value
+ , typename detail::identity<Seq>::type
+ >::type
+ >::type
+ type;
+
+ static type
+ call(Seq seq)
+ {
+ return tuples::get<N::value>(BOOST_FUSION_FORWARD(Seq,seq));
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/begin_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/begin_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,43 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009 Christopher Schmidt
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_BEGIN_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_BEGIN_IMPL_HPP
+
+#include <boost/fusion/iterator/basic_iterator.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct begin_impl;
+
+ template <>
+ struct begin_impl<boost_tuple_tag>
+ {
+ template <typename Seq>
+ struct apply
+ {
+ typedef
+ basic_iterator<
+ boost_tuple_iterator_tag
+ , random_access_traversal_tag
+ , typename detail::add_lref<Seq>::type
+ , 0
+ >
+ type;
+
+ static type
+ call(Seq seq)
+ {
+ return type(seq,0);
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/category_of_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/category_of_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,32 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_CATEGORY_OF_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_CATEGORY_OF_IMPL_HPP
+
+namespace boost { namespace fusion
+{
+ struct random_access_traversal_tag;
+
+ namespace extension
+ {
+ template<typename>
+ struct category_of_impl;
+
+ template<>
+ struct category_of_impl<boost_tuple_tag>
+ {
+ template<typename Seq>
+ struct apply
+ {
+ typedef random_access_traversal_tag type;
+ };
+ };
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/deref_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/deref_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,45 @@
+/*=============================================================================
+ Copyright (c) 2009 Christopher Schmidt
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_DEREF_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_DEREF_IMPL_HPP
+
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename>
+ struct deref_impl;
+
+ template <>
+ struct deref_impl<boost_tuple_iterator_tag>
+ {
+ template <typename It>
+ struct apply
+ {
+ typedef typename detail::remove_reference<It>::type it;
+
+ typedef typename
+ detail::forward_as<
+ typename it::seq_type
+ , typename tuples::element<
+ it::index::value
+ , typename detail::remove_reference<
+ typename it::seq_type
+ >::type
+ >::type
+ >::type
+ type;
+
+ static type
+ call(It it_)
+ {
+ return get<it::index::value>(*it_.seq);
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/end_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/end_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,45 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009 Christopher Schmidt
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_END_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_END_IMPL_HPP
+
+#include <boost/fusion/iterator/basic_iterator.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename>
+ struct end_impl;
+
+ template <>
+ struct end_impl<boost_tuple_tag>
+ {
+ template <typename Seq>
+ struct apply
+ {
+ typedef
+ basic_iterator<
+ boost_tuple_iterator_tag
+ , random_access_traversal_tag
+ , typename detail::add_lref<Seq>::type
+ , tuples::length<
+ typename detail::identity<Seq>::type
+ >::value
+ >
+ type;
+
+ static type
+ call(Seq seq)
+ {
+ return type(seq,0);
+ }
+ };
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/is_sequence_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/is_sequence_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_IS_SEQUENCE_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_IS_SEQUENCE_IMPL_HPP
+
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct is_sequence_impl;
+
+ template<>
+ struct is_sequence_impl<boost_tuple_tag>
+ {
+ template<typename Seq>
+ struct apply
+ : mpl::true_
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/is_view_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/is_view_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,28 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_IS_VIEW_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_IS_VIEW_IMPL_HPP
+
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct is_view_impl;
+
+ template<>
+ struct is_view_impl<boost_tuple_tag>
+ {
+ template<typename Seq>
+ struct apply
+ : mpl::false_
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/size_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/size_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,30 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_SIZE_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_SIZE_IMPL_HPP
+
+#include <boost/mpl/int.hpp>
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct size_impl;
+
+ template <>
+ struct size_impl<boost_tuple_tag>
+ {
+ template <typename Seq>
+ struct apply
+ : mpl::int_<
+ tuples::length<typename detail::identity<Seq>::type>::value
+ >
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/tag_of.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/tag_of.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,80 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2009 Christopher Schmidt
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_TAG_OF_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_TAG_OF_HPP
+
+#include <boost/config.hpp>
+#include <boost/fusion/support/tag_of_fwd.hpp>
+
+namespace boost { namespace fusion
+{
+ struct boost_tuple_tag;
+ struct boost_tuple_iterator_tag;
+
+ namespace traits
+ {
+#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
+# define BOOST_FUSION_TUPLE_TAG_OF_SPECIALIZATION(COMBINATION,_)\
+ template <\
+ class T0, class T1, class T2, class T3, class T4, \
+ class T5, class T6, class T7, class T8, class T9\
+ >\
+ struct tag_of<\
+ tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> COMBINATION\
+ , void\
+ >\
+ {\
+ typedef boost_tuple_tag type;\
+ };\
+ \
+ template <class Head, class Tail>\
+ struct tag_of<tuples::cons<Head, Tail> COMBINATION,void>\
+ {\
+ typedef boost_tuple_tag type;\
+ };\
+ \
+ template <>\
+ struct tag_of<tuples::null_type COMBINATION,void>\
+ {\
+ typedef boost_tuple_tag type;\
+ };
+#else
+# define BOOST_FUSION_TUPLE_TAG_OF_SPECIALIZATION(COMBINATION,_)\
+ template <\
+ class T0, class T1, class T2, class T3, class T4, \
+ class T5, class T6, class T7, class T8, class T9\
+ >\
+ struct tag_of<\
+ tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> COMBINATION\
+ >\
+ {\
+ typedef boost_tuple_tag type;\
+ };\
+ \
+ template <class Head, class Tail>\
+ struct tag_of<tuples::cons<Head, Tail> COMBINATION>\
+ {\
+ typedef boost_tuple_tag type;\
+ };\
+ \
+ template <>\
+ struct tag_of<tuples::null_type COMBINATION>\
+ {\
+ typedef boost_tuple_tag type;\
+ };
+#endif
+
+ BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS(
+ BOOST_FUSION_TUPLE_TAG_OF_SPECIALIZATION,_)
+
+#undef BOOST_FUSION_TUPLE_TAG_OF_SPECIALIZATION
+ }
+}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/value_at_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/value_at_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,26 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_VALUE_AT_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_VALUE_AT_IMPL_HPP
+
+namespace boost { namespace fusion { namespace extension
+{
+ template<typename>
+ struct value_at_impl;
+
+ template <>
+ struct value_at_impl<boost_tuple_tag>
+ {
+ template <typename Seq, typename N>
+ struct apply
+ : tuples::element<N::value, typename detail::identity<Seq>::type>
+ {};
+ };
+}}}
+
+#endif

Added: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/value_of_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/tuple/value_of_impl.hpp 2009-09-17 14:59:24 EDT (Thu, 17 Sep 2009)
@@ -0,0 +1,36 @@
+/*=============================================================================
+ Copyright (c) 2009 Christopher Schmidt
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_VALUE_OF_IMPL_HPP
+#define BOOST_FUSION_ADAPTED_DETAIL_BOOST_TUPLE_VALUE_OF_IMPL_HPP
+
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename>
+ struct value_of_impl;
+
+ template <>
+ struct value_of_impl<boost_tuple_iterator_tag>
+ {
+ template <typename It>
+ struct apply
+ {
+ typedef typename detail::remove_reference<It>::type it;
+
+ typedef typename
+ tuples::element<
+ it::index::value
+ , typename detail::remove_reference<
+ typename it::seq_type
+ >::type
+ >::type
+ type;
+ };
+ };
+}}}
+
+#endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk