1 /* Copyright 2016-2017 Joaquin M Lopez Munoz. 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 * 6 * See http://www.boost.org/libs/poly_collection for library home page. 7 */ 8 9 #ifndef BOOST_POLY_COLLECTION_EXCEPTION_HPP 10 #define BOOST_POLY_COLLECTION_EXCEPTION_HPP 11 12 #if defined(_MSC_VER) 13 #pragma once 14 #endif 15 16 #include <stdexcept> 17 #include <typeinfo> 18 19 namespace boost{ 20 21 namespace poly_collection{ 22 23 struct unregistered_type:std::logic_error 24 { unregistered_typeboost::poly_collection::unregistered_type25 unregistered_type(const std::type_info& info): 26 std::logic_error{"type not registered"}, 27 pinfo{&info} 28 {} 29 30 const std::type_info* pinfo; 31 }; 32 33 struct not_copy_constructible:std::logic_error 34 { not_copy_constructibleboost::poly_collection::not_copy_constructible35 not_copy_constructible(const std::type_info& info): 36 std::logic_error{"type is not copy constructible"}, 37 pinfo{&info} 38 {} 39 40 const std::type_info* pinfo; 41 }; 42 43 struct not_equality_comparable:std::logic_error 44 { not_equality_comparableboost::poly_collection::not_equality_comparable45 not_equality_comparable(const std::type_info& info): 46 std::logic_error{"type does not support equality comparison"}, 47 pinfo{&info} 48 {} 49 50 const std::type_info* pinfo; 51 }; 52 53 } /* namespace poly_collection */ 54 55 } /* namespace boost */ 56 57 #endif 58