void_return.hpp 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef VOID_RETURN_DWA200274_HPP
  6. # define VOID_RETURN_DWA200274_HPP
  7. # include <boost/config.hpp>
  8. namespace boost { namespace python { namespace detail {
  9. struct void_return
  10. {
  11. void_return() {}
  12. private:
  13. void operator=(void_return const&);
  14. };
  15. template <class T>
  16. struct returnable
  17. {
  18. typedef T type;
  19. };
  20. # ifdef BOOST_NO_VOID_RETURNS
  21. template <>
  22. struct returnable<void>
  23. {
  24. typedef void_return type;
  25. };
  26. # ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
  27. template <> struct returnable<const void> : returnable<void> {};
  28. template <> struct returnable<volatile void> : returnable<void> {};
  29. template <> struct returnable<const volatile void> : returnable<void> {};
  30. # endif
  31. # endif // BOOST_NO_VOID_RETURNS
  32. }}} // namespace boost::python::detail
  33. #endif // VOID_RETURN_DWA200274_HPP