value_arg.hpp 727 B

1234567891011121314151617181920212223242526
  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/python/detail/indirect_traits.hpp>
  9. namespace boost { namespace python { namespace detail {
  10. template <class T>
  11. struct value_arg
  12. : mpl::if_<
  13. copy_ctor_mutates_rhs<T>
  14. , T
  15. , typename add_lvalue_reference<
  16. typename add_const<T>::type
  17. >::type
  18. >
  19. {};
  20. }}} // namespace boost::python::detail
  21. #endif // VALUE_ARG_DWA2004312_HPP