Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // -- Boost Lambda Library -------------------------------------------------
3 // Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // For more information, see www.boost.org
11 // --------------------------------------------------
13 #ifndef BOOST_LAMBDA_ARITY_CODE_HPP
14 #define BOOST_LAMBDA_ARITY_CODE_HPP
16 #include "boost/type_traits/cv_traits.hpp"
17 #include "boost/type_traits/transform_traits.hpp"
22 // These constants state, whether a lambda_functor instantiation results from
23 // an expression which contains no placeholders (NONE),
24 // only free1 placeholders (FIRST),
25 // free2 placeholders and maybe free1 placeholders (SECOND),
26 // free3 and maybe free1 and free2 placeholders (THIRD),
27 // freeE placeholders and maybe free1 and free2 (EXCEPTION).
28 // RETHROW means, that a rethrow expression is used somewhere in the lambda_functor.
30 enum { NONE = 0x00, // Notice we are using bits as flags here.
39 struct get_tuple_arity;
43 template <class T> struct get_arity_;
47 template <class T> struct get_arity {
49 BOOST_STATIC_CONSTANT(int, value = detail::get_arity_<typename boost::remove_cv<typename boost::remove_reference<T>::type>::type>::value);
57 BOOST_STATIC_CONSTANT(int, value = 0);
61 struct get_arity_<lambda_functor<T> > {
62 BOOST_STATIC_CONSTANT(int, value = get_arity<T>::value);
65 template<class Action, class Args>
66 struct get_arity_<lambda_functor_base<Action, Args> > {
67 BOOST_STATIC_CONSTANT(int, value = get_tuple_arity<Args>::value);
71 struct get_arity_<placeholder<I> > {
72 BOOST_STATIC_CONSTANT(int, value = I);
78 struct get_tuple_arity {
79 BOOST_STATIC_CONSTANT(int, value = get_arity<typename T::head_type>::value | get_tuple_arity<typename T::tail_type>::value);
84 struct get_tuple_arity<null_type> {
85 BOOST_STATIC_CONSTANT(int, value = 0);
89 // Does T have placeholder<I> as it's subexpression?
91 template<class T, int I>
92 struct has_placeholder {
93 BOOST_STATIC_CONSTANT(bool, value = (get_arity<T>::value & I) != 0);
96 template<int I, int J>
97 struct includes_placeholder {
98 BOOST_STATIC_CONSTANT(bool, value = (J & I) != 0);
101 template<int I, int J>
102 struct lacks_placeholder {
103 BOOST_STATIC_CONSTANT(bool, value = ((J & I) == 0));
107 } // namespace lambda