helper2.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //Copyright (c) 2006-2009 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. #include "helper2.hpp"
  5. #include <boost/throw_exception.hpp>
  6. namespace
  7. boost
  8. {
  9. namespace
  10. exception_test
  11. {
  12. inline
  13. derives_boost_exception::
  14. derives_boost_exception( int x ):
  15. x_(x)
  16. {
  17. }
  18. derives_boost_exception::
  19. ~derives_boost_exception() BOOST_NOEXCEPT_OR_NOTHROW
  20. {
  21. }
  22. inline
  23. derives_boost_exception_virtually::
  24. derives_boost_exception_virtually( int x ):
  25. x_(x)
  26. {
  27. }
  28. derives_boost_exception_virtually::
  29. ~derives_boost_exception_virtually() BOOST_NOEXCEPT_OR_NOTHROW
  30. {
  31. }
  32. inline
  33. derives_std_exception::
  34. derives_std_exception( int x ):
  35. x_(x)
  36. {
  37. }
  38. derives_std_exception::
  39. ~derives_std_exception() BOOST_NOEXCEPT_OR_NOTHROW
  40. {
  41. }
  42. template <>
  43. void
  44. throw_test_exception<derives_boost_exception>( int x )
  45. {
  46. boost::throw_exception( derives_boost_exception(x) );
  47. }
  48. template <>
  49. void
  50. throw_test_exception<derives_boost_exception_virtually>( int x )
  51. {
  52. boost::throw_exception( derives_boost_exception_virtually(x) );
  53. }
  54. template <>
  55. void
  56. throw_test_exception<derives_std_exception>( int x )
  57. {
  58. boost::throw_exception( derives_std_exception(x) );
  59. }
  60. }
  61. }