/usr/include/boost/proto/detail/traits.hpp is in libboost1.54-dev 1.54.0-4ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
#include <boost/proto/detail/preprocessed/traits.hpp>
#elif !defined(BOOST_PP_IS_ITERATING)
#define BOOST_PROTO_CHILD(Z, N, DATA) \
/** INTERNAL ONLY */ \
typedef BOOST_PP_CAT(DATA, N) BOOST_PP_CAT(proto_child, N); \
/**/
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/traits.hpp")
#endif
///////////////////////////////////////////////////////////////////////////////
/// \file traits.hpp
/// Definitions of proto::function, proto::nary_expr and proto::result_of::child_c
//
// Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/traits.hpp>))
#include BOOST_PP_ITERATE()
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#undef BOOST_PROTO_CHILD
#else // BOOST_PP_IS_ITERATING
#define N BOOST_PP_ITERATION()
#if N > 0
/// \brief A metafunction for generating function-call expression types,
/// a grammar element for matching function-call expressions, and a
/// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
/// transform.
template<BOOST_PP_ENUM_PARAMS(N, typename A)>
struct function
#if N != BOOST_PROTO_MAX_ARITY
<
BOOST_PP_ENUM_PARAMS(N, A)
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
#endif
: proto::transform<
function<
BOOST_PP_ENUM_PARAMS(N, A)
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
, int
>
{
typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
typedef proto::basic_expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
template<typename Expr, typename State, typename Data>
struct impl
: detail::pass_through_impl<function, deduce_domain, Expr, State, Data>
{};
/// INTERNAL ONLY
typedef proto::tag::function proto_tag;
BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
BOOST_PP_REPEAT_FROM_TO(
N
, BOOST_PROTO_MAX_ARITY
, BOOST_PROTO_CHILD
, detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
)
};
/// \brief A metafunction for generating n-ary expression types with a
/// specified tag type,
/// a grammar element for matching n-ary expressions, and a
/// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
/// transform.
///
/// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
/// n-ary expression; that is, any non-terminal.
template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct nary_expr
#if N != BOOST_PROTO_MAX_ARITY
<
Tag
BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
#endif
: proto::transform<
nary_expr<
Tag
BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
, int
>
{
typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
typedef proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
template<typename Expr, typename State, typename Data>
struct impl
: detail::pass_through_impl<nary_expr, deduce_domain, Expr, State, Data>
{};
/// INTERNAL ONLY
typedef Tag proto_tag;
BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
BOOST_PP_REPEAT_FROM_TO(
N
, BOOST_PROTO_MAX_ARITY
, BOOST_PROTO_CHILD
, detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
)
};
namespace detail
{
template<
template<BOOST_PP_ENUM_PARAMS(N, typename BOOST_PP_INTERCEPT)> class T
, BOOST_PP_ENUM_PARAMS(N, typename A)
>
struct is_callable_<T<BOOST_PP_ENUM_PARAMS(N, A)> BOOST_PROTO_TEMPLATE_ARITY_PARAM(N)>
: is_same<BOOST_PP_CAT(A, BOOST_PP_DEC(N)), callable>
{};
}
#endif
namespace result_of
{
/// \brief A metafunction that returns the type of the Nth child
/// of a Proto expression.
///
/// A metafunction that returns the type of the Nth child
/// of a Proto expression. \c N must be less than
/// \c Expr::proto_arity::value.
template<typename Expr>
struct child_c<Expr, N>
{
/// Verify that we are not operating on a terminal
BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
/// The raw type of the Nth child as it is stored within
/// \c Expr. This may be a value or a reference
typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
/// The "value" type of the child, suitable for return by value,
/// computed as follows:
/// \li <tt>T const &</tt> becomes <tt>T</tt>
/// \li <tt>T &</tt> becomes <tt>T</tt>
/// \li <tt>T</tt> becomes <tt>T</tt>
typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::value_type type;
};
template<typename Expr>
struct child_c<Expr &, N>
{
/// Verify that we are not operating on a terminal
BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
/// The raw type of the Nth child as it is stored within
/// \c Expr. This may be a value or a reference
typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
/// The "reference" type of the child, suitable for return by
/// reference, computed as follows:
/// \li <tt>T const &</tt> becomes <tt>T const &</tt>
/// \li <tt>T &</tt> becomes <tt>T &</tt>
/// \li <tt>T</tt> becomes <tt>T &</tt>
typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::reference type;
/// INTERNAL ONLY
///
BOOST_FORCEINLINE
static type call(Expr &e)
{
return e.proto_base().BOOST_PP_CAT(child, N);
}
};
template<typename Expr>
struct child_c<Expr const &, N>
{
/// Verify that we are not operating on a terminal
BOOST_STATIC_ASSERT(0 != Expr::proto_arity_c);
/// The raw type of the Nth child as it is stored within
/// \c Expr. This may be a value or a reference
typedef typename Expr::BOOST_PP_CAT(proto_child, N) value_type;
/// The "const reference" type of the child, suitable for return by
/// const reference, computed as follows:
/// \li <tt>T const &</tt> becomes <tt>T const &</tt>
/// \li <tt>T &</tt> becomes <tt>T &</tt>
/// \li <tt>T</tt> becomes <tt>T const &</tt>
typedef typename detail::expr_traits<typename Expr::BOOST_PP_CAT(proto_child, N)>::const_reference type;
/// INTERNAL ONLY
///
BOOST_FORCEINLINE
static type call(Expr const &e)
{
return e.proto_base().BOOST_PP_CAT(child, N);
}
};
}
#undef N
#endif
|