Added adapter for std::tuple (only for implementations using variadic templates)

[SVN r74788]
This commit is contained in:
Joel de Guzman
2011-10-08 03:47:16 +00:00
parent e08976a68d
commit b905aa11af

View File

@ -1,7 +1,7 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#if !defined(FUSION_AT_05042005_0722) #if !defined(FUSION_AT_05042005_0722)
@ -21,6 +21,7 @@ namespace boost { namespace fusion
struct boost_array_tag; // boost::array tag struct boost_array_tag; // boost::array tag
struct mpl_sequence_tag; // mpl sequence tag struct mpl_sequence_tag; // mpl sequence tag
struct std_pair_tag; // std::pair tag struct std_pair_tag; // std::pair tag
struct std_tuple_tag; // std::tuple tag
namespace extension namespace extension
{ {
@ -49,12 +50,15 @@ namespace boost { namespace fusion
template <> template <>
struct at_impl<std_pair_tag>; struct at_impl<std_pair_tag>;
template <>
struct at_impl<std_tuple_tag>;
} }
namespace result_of namespace result_of
{ {
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct at struct at
: extension::at_impl<typename detail::tag_of<Sequence>::type>:: : extension::at_impl<typename detail::tag_of<Sequence>::type>::
template apply<Sequence, N> template apply<Sequence, N>
{}; {};
@ -67,7 +71,7 @@ namespace boost { namespace fusion
template <typename N, typename Sequence> template <typename N, typename Sequence>
inline typename inline typename
lazy_disable_if< lazy_disable_if<
is_const<Sequence> is_const<Sequence>
, result_of::at<Sequence, N> , result_of::at<Sequence, N>
@ -85,7 +89,7 @@ namespace boost { namespace fusion
} }
template <int N, typename Sequence> template <int N, typename Sequence>
inline typename inline typename
lazy_disable_if< lazy_disable_if<
is_const<Sequence> is_const<Sequence>
, result_of::at_c<Sequence, N> , result_of::at_c<Sequence, N>