diff DEPENDENCIES/generic/include/boost/phoenix/function/adapt_callable.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DEPENDENCIES/generic/include/boost/phoenix/function/adapt_callable.hpp	Tue Aug 05 11:11:38 2014 +0100
@@ -0,0 +1,58 @@
+/*==============================================================================
+    Copyright (c) 2005-2010 Joel de Guzman
+    Copyright (c) 2011 Thomas Heller
+
+    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_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP
+#define BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP
+
+#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/detail/function_eval.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC)                        \
+    boost::phoenix::detail::expression::function_eval<FUNC>::type const         \
+    inline NAME()                                                               \
+    {                                                                           \
+        return boost::phoenix::detail::expression::                             \
+                function_eval<FUNC>::make(FUNC());                              \
+    }                                                                           \
+/**/
+
+
+#define BOOST_PHOENIX_ADAPT_CALLABLE(NAME, FUNC, N)                             \
+    template <BOOST_PHOENIX_typename_A(N)>                                      \
+    typename                                                                    \
+        boost::phoenix::detail::expression::function_eval<                      \
+            FUNC                                                                \
+          , BOOST_PHOENIX_A(N)>::type const                                     \
+    inline NAME(BOOST_PHOENIX_A_const_ref_a(N))                                 \
+    {                                                                           \
+        return boost::phoenix::detail::expression::                             \
+            function_eval<FUNC, BOOST_PHOENIX_A(N)>::                           \
+                make(FUNC(), BOOST_PHOENIX_a(N));                               \
+    }                                                                           \
+/**/
+
+
+#define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG(NAME, FUNC)                         \
+    BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC)                            \
+    BOOST_PP_REPEAT_FROM_TO(                                                    \
+        1                                                                       \
+      , BOOST_PHOENIX_LIMIT                                                     \
+      , BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R                                   \
+      , (NAME, FUNC)                                                            \
+    )                                                                           \
+/**/
+
+#define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R(Z, N, D)                          \
+    BOOST_PHOENIX_ADAPT_CALLABLE(                                               \
+        BOOST_PP_TUPLE_ELEM(2, 0, D)                                            \
+      , BOOST_PP_TUPLE_ELEM(2, 1, D)                                            \
+      , N                                                                       \
+    )                                                                           \
+/**/
+
+#endif