bad_weak_ptr.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef BOOST_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // boost/smart_ptr/bad_weak_ptr.hpp
  9. //
  10. // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
  11. //
  12. // Distributed under the Boost Software License, Version 1.0. (See
  13. // accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt)
  15. //
  16. #include <exception>
  17. #ifdef __BORLANDC__
  18. # pragma warn -8026 // Functions with excep. spec. are not expanded inline
  19. #endif
  20. namespace boost
  21. {
  22. // The standard library that comes with Borland C++ 5.5.1, 5.6.4
  23. // defines std::exception and its members as having C calling
  24. // convention (-pc). When the definition of bad_weak_ptr
  25. // is compiled with -ps, the compiler issues an error.
  26. // Hence, the temporary #pragma option -pc below.
  27. #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564
  28. # pragma option push -pc
  29. #endif
  30. class bad_weak_ptr: public std::exception
  31. {
  32. public:
  33. virtual char const * what() const throw()
  34. {
  35. return "tr1::bad_weak_ptr";
  36. }
  37. };
  38. #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564
  39. # pragma option pop
  40. #endif
  41. } // namespace boost
  42. #ifdef __BORLANDC__
  43. # pragma warn .8026 // Functions with excep. spec. are not expanded inline
  44. #endif
  45. #endif // #ifndef BOOST_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED