1 //---------------------------------------------------------------------------// 2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com> 3 // 4 // Distributed under the Boost Software License, Version 1.0 5 // See accompanying file LICENSE_1_0.txt or copy at 6 // http://www.boost.org/LICENSE_1_0.txt 7 // 8 // See http://boostorg.github.com/compute for more information. 9 //---------------------------------------------------------------------------// 10 11 #ifndef BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP 12 #define BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP 13 14 #include <boost/preprocessor/cat.hpp> 15 #include <boost/preprocessor/stringize.hpp> 16 17 #include <boost/compute/function.hpp> 18 19 #define BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(name, signature, template_args) \ 20 template<template_args> \ 21 class name : public function<signature> \ 22 { \ 23 public: \ 24 (name)() : function<signature>(BOOST_PP_STRINGIZE(name)) { } \ 25 }; 26 27 #define BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(name, signature, template_args) \ 28 template<template_args> \ 29 class BOOST_PP_CAT(name, _) : public function<signature> \ 30 { \ 31 public: \ 32 BOOST_PP_CAT(name, _)() : function<signature>(BOOST_PP_STRINGIZE(name)) { } \ 33 }; 34 35 #endif // BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP 36