N3757.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //Copyright (c) 2006-2013 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost 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 UUID_9011016A11A711E3B46CD9FA6088709B
  5. #define UUID_9011016A11A711E3B46CD9FA6088709B
  6. #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  7. #pragma GCC system_header
  8. #endif
  9. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  10. #pragma warning(push,1)
  11. #endif
  12. #include <boost/exception/info.hpp>
  13. #include <boost/exception/get_error_info.hpp>
  14. namespace
  15. boost
  16. {
  17. //Here we're using the boost::error_info machinery to store the info in the exception
  18. //object. Within the context of N3757, this is strictly an implementation detail.
  19. template <class Tag>
  20. inline
  21. void
  22. exception::
  23. set( typename Tag::type const & v )
  24. {
  25. exception_detail::set_info(*this,error_info<Tag,typename Tag::type>(v));
  26. }
  27. template <class Tag>
  28. inline
  29. typename Tag::type const *
  30. exception::
  31. get() const
  32. {
  33. return get_error_info<error_info<Tag,typename Tag::type> >(*this);
  34. }
  35. }
  36. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  37. #pragma warning(pop)
  38. #endif
  39. #endif