copy_ctor_mutates_rhs.cpp 717 B

1234567891011121314151617181920212223
  1. // Copyright David Abrahams 2003.
  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. #include <boost/python/detail/copy_ctor_mutates_rhs.hpp>
  6. #include <boost/static_assert.hpp>
  7. #include <memory>
  8. #include <string>
  9. struct foo
  10. {
  11. operator std::auto_ptr<int>&() const;
  12. };
  13. int main()
  14. {
  15. using namespace boost::python::detail;
  16. BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs<int>::value);
  17. BOOST_STATIC_ASSERT(copy_ctor_mutates_rhs<std::auto_ptr<int> >::value);
  18. BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs<std::string>::value);
  19. BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs<foo>::value);
  20. return 0;
  21. }