const_argument.cpp 778 B

12345678910111213141516171819202122232425262728
  1. /* Copyright 2004 Jonathan Brandmeyer
  2. * Use, modification and distribution are subject to the
  3. * Boost Software License, Version 1.0. (See accompanying file
  4. * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * The purpose of this test is to determine if a function can be called from
  7. * Python with a const value type as an argument, and whether or not the
  8. * presence of a prototype without the cv-qualifier will work around the
  9. * compiler's bug.
  10. */
  11. #include <boost/python.hpp>
  12. using namespace boost::python;
  13. #if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
  14. bool accept_const_arg( object );
  15. #endif
  16. bool accept_const_arg( const object )
  17. {
  18. return true;
  19. }
  20. BOOST_PYTHON_MODULE( const_argument_ext )
  21. {
  22. def( "accept_const_arg", accept_const_arg );
  23. }