macros.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP
  11. #define BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP
  12. #include <boost/preprocessor/cat.hpp>
  13. #include <boost/preprocessor/stringize.hpp>
  14. #include <boost/compute/function.hpp>
  15. #define BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(name, signature, template_args) \
  16. template<template_args> \
  17. class name : public function<signature> \
  18. { \
  19. public: \
  20. (name)() : function<signature>(BOOST_PP_STRINGIZE(name)) { } \
  21. };
  22. #define BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(name, signature, template_args) \
  23. template<template_args> \
  24. class BOOST_PP_CAT(name, _) : public function<signature> \
  25. { \
  26. public: \
  27. BOOST_PP_CAT(name, _)() : function<signature>(BOOST_PP_STRINGIZE(name)) { } \
  28. };
  29. #endif // BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP