intrusive.hpp (906B)
1 #ifndef GUARD_SUITABLY_PANDEROUS_ENFRINGEMENT_OUTMATCHES_9679 2 #define GUARD_SUITABLY_PANDEROUS_ENFRINGEMENT_OUTMATCHES_9679 3 #pragma once 4 5 #include "libshit/except.hpp" 6 #include "libshit/platform.hpp" 7 8 #include <boost/intrusive/link_mode.hpp> 9 #include <boost/intrusive/options.hpp> 10 11 namespace Libshit 12 { 13 14 using LinkMode = boost::intrusive::link_mode< 15 LIBSHIT_IS_DEBUG ? boost::intrusive::safe_link : boost::intrusive::normal_link>; 16 17 LIBSHIT_GEN_EXCEPTION_TYPE(ContainerConsistency, std::logic_error); 18 // trying to add an already linked item to an intrusive container 19 LIBSHIT_GEN_EXCEPTION_TYPE(ItemAlreadyAdded, ContainerConsistency); 20 // item not linked, linked to a different container, item is a root node, ... 21 LIBSHIT_GEN_EXCEPTION_TYPE(ItemNotInContainer, ContainerConsistency); 22 // invalid item (nullptr, ...) 23 LIBSHIT_GEN_EXCEPTION_TYPE(InvalidItem, ContainerConsistency); 24 25 } 26 27 #endif