/*============================================================================== Copyright (c) 2001-2010 Joel de Guzman Copyright (c) 2010 Eric Niebler Copyright (c) 2015 John Fletcher 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_FUNCTION_HPP #define BOOST_PHOENIX_FUNCTION_FUNCTION_HPP #include #include #include #include namespace boost { namespace phoenix { ///////////////////////////////////////////////////////////////////////////// // Functions ///////////////////////////////////////////////////////////////////////////// namespace expression { #if defined(BOOST_PHOENIX_NO_VARIADIC_FUNCTION) template struct function : detail::expression::function_eval {}; #else // TODO: #endif } // functor which returns our lazy function call extension template struct function { BOOST_CONSTEXPR function() : f() {} BOOST_CONSTEXPR function(F f_) : f(f_) {} template struct result; #if defined(BOOST_PHOENIX_NO_VARIADIC_FUNCTION) typename detail::expression::function_eval::type const operator()() const { return detail::expression::function_eval::make(f); } // Bring in the rest #include // Solves the result problem for F(X) template struct result : detail::expression::function_eval::type> {}; // Solves the result problem for F(X,Y) template struct result : detail::expression::function_eval::type, typename boost::remove_reference::type> {}; // Solves the result problem for F(X,Y,Z) template struct result : detail::expression::function_eval::type, typename boost::remove_reference::type, typename boost::remove_reference::type> {}; // Solves the result problem for F(W,X,Y,Z) template struct result : detail::expression::function_eval::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type> {}; // Solves the result problem for F(V,W,X,Y,Z) template struct result : detail::expression::function_eval::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type> {}; // Solves the result problem for F(U,V,W,X,Y,Z) template struct result : detail::expression::function_eval::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type> {}; // Solves the result problem for F(T,U,V,W,X,Y,Z) template struct result : detail::expression::function_eval::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type, typename boost::remove_reference::type> {}; #else // TODO: #endif F f; }; } template struct result_of()> : phoenix::detail::expression::function_eval {}; } #endif