value_arg.hpp 760 B

123456789101112131415161718192021222324252627
  1. // Copyright David Abrahams 2004. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef VALUE_ARG_DWA2004312_HPP
  5. # define VALUE_ARG_DWA2004312_HPP
  6. # include <boost/python/detail/copy_ctor_mutates_rhs.hpp>
  7. # include <boost/mpl/if.hpp>
  8. # include <boost/type_traits/add_reference.hpp>
  9. # include <boost/type_traits/add_const.hpp>
  10. namespace boost { namespace python { namespace detail {
  11. template <class T>
  12. struct value_arg
  13. : mpl::if_<
  14. copy_ctor_mutates_rhs<T>
  15. , T
  16. , typename add_reference<
  17. typename add_const<T>::type
  18. >::type
  19. >
  20. {};
  21. }}} // namespace boost::python::detail
  22. #endif // VALUE_ARG_DWA2004312_HPP