#ifndef BOOST_PHOENIX_STL_TUPLE_H_
#define BOOST_PHOENIX_STL_TUPLE_H_
#if __cplusplus >= 201402L \
|| (defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190024210)
#include <tuple>
#include <boost/phoenix/core/argument.hpp>
#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
namespace boost { namespace phoenix { namespace tuple_detail
{
template<typename T>
struct type_wrap
{
typedef T type;
};
template<int N>
struct idx_wrap
{
static constexpr int idx = N;
};
}}}
BOOST_PHOENIX_DEFINE_EXPRESSION(
(boost)(phoenix)(get_with_type),
(proto::terminal<tuple_detail::type_wrap<proto::_> >)(meta_grammar))
BOOST_PHOENIX_DEFINE_EXPRESSION(
(boost)(phoenix)(get_with_idx),
(proto::terminal<proto::_>)(meta_grammar))
namespace boost { namespace phoenix {
namespace impl {
struct get_with_type
{
template<typename T, typename Expr, typename Context>
auto& operator()(T, const Expr& t, const Context& ctx) const
{
using std::get; using T_ = typename proto::result_of::value<T>::type;
return get<typename T_::type>(boost::phoenix::eval(t, ctx));
}
};
struct get_with_idx
{
template<typename T, typename Expr, typename Context>
auto& operator()(T, const Expr& t, const Context& ctx) const
{
using std::get; using T_ = typename proto::result_of::value<T>::type;
return get<T_::idx>(boost::phoenix::eval(t, ctx));
}
};
}
template<typename Dummy>
struct default_actions::when<rule::get_with_type, Dummy>
: call<impl::get_with_type, Dummy>
{};
template<typename Dummy>
struct default_actions::when<rule::get_with_idx, Dummy>
: call<impl::get_with_idx, Dummy>
{};
template<typename T, typename Tuple>
inline typename expression::get_with_type<tuple_detail::type_wrap<T>, Tuple>::
type const
get_(const Tuple& t)
{
return expression::get_with_type<tuple_detail::type_wrap<T>, Tuple>::make(
tuple_detail::type_wrap<T>(), t);
}
template<int N, typename Tuple>
inline typename expression::get_with_idx<tuple_detail::idx_wrap<N>, Tuple>::
type const
get_(const Tuple& t)
{
return expression::get_with_idx<tuple_detail::idx_wrap<N>, Tuple>::make(
tuple_detail::idx_wrap<N>(), t);
}
#if 0#endif
}}
#endif #endif