fix doc example typo
[boost.git] / boost / ptr_container / exception.hpp
blobd9a5ffeaf5559b05d47d96a6b5cec076dcbaf566
1 //
2 // Boost.Pointer Container
3 //
4 // Copyright Thorsten Ottosen 2003-2005. 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/
12 #ifndef BOOST_PTR_CONTAINER_EXCEPTION_HPP
13 #define BOOST_PTR_CONTAINER_EXCEPTION_HPP
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 # pragma once
17 #endif
19 #include <exception>
21 namespace boost
23 class bad_ptr_container_operation : public std::exception
25 const char* what_;
26 public:
27 bad_ptr_container_operation( const char* what ) : what_( what )
28 { }
30 virtual const char* what() const throw()
32 return what_;
38 class bad_index : public bad_ptr_container_operation
40 public:
41 bad_index( const char* what ) : bad_ptr_container_operation( what )
42 { }
47 class bad_pointer : public bad_ptr_container_operation
49 public:
50 bad_pointer() : bad_ptr_container_operation( "Null pointer not allowed in a pointer container!" )
51 { }
53 bad_pointer( const char* text ) : bad_ptr_container_operation( text )
54 { }
58 #endif