throw_exception.hpp 854 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // Boost.Pointer Container
  3. //
  4. // Copyright Thorsten Ottosen 2006. Use, modification and
  5. // distribution is subject to the Boost Software License, Version
  6. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // For more information, see http://www.boost.org/libs/ptr_container/
  10. //
  11. #ifndef BOOST_PTR_CONTAINER_DETAIL_THROW_EXCEPTION
  12. #define BOOST_PTR_CONTAINER_DETAIL_THROW_EXCEPTION
  13. #include <boost/assert.hpp>
  14. #include <boost/config.hpp>
  15. #ifdef BOOST_NO_EXCEPTIONS
  16. #define BOOST_PTR_CONTAINER_NO_EXCEPTIONS
  17. #endif
  18. #ifdef BOOST_PTR_CONTAINER_NO_EXCEPTIONS
  19. #define BOOST_PTR_CONTAINER_THROW_EXCEPTION( If, Ex, Msg ) BOOST_ASSERT( !(If) && Msg )
  20. #else
  21. #define BOOST_PTR_CONTAINER_THROW_EXCEPTION( If, Ex, Msg ) if( (If) ) throw Ex ( Msg )
  22. #endif // BOOST_PTR_CONTAINER_NO_EXCEPTIONS
  23. #endif