Hello,
I'm a user of boost::unordered_map and I always used this container with
exceptions disabled (because I never use them and don't want them enabled
if possible). I never had problems with that, but now with boost 1.50 and
GCC 4.7.1 I get this error while compiling code using unordered_map:
In file included from /usr/include/boost/unordered/unordered_map.hpp:17:0,
from /usr/include/boost/unordered_map.hpp:16,
from /home/hades/Bitral/include/CodeRegion.h:23,
from /home/hades/Bitral/src/BitralContext.cpp:20:
/usr/include/boost/unordered/detail/allocator_helpers.hpp: In instantiation
of 'void boost::unordered::detail::construct_node(Alloc&, T*, const Args&)
[with Alloc =
std::allocator > >; T =
boost::unordered::detail::ptr_node >; Args =
boost::unordered::detail::emplace_args3, boost::tuples::tuple<> >]':
/usr/include/boost/unordered/detail/buckets.hpp:75:13: required from
'void
boost::unordered::detail::node_constructor<NodeAlloc>::construct_value(const
Args&) [with Args =
boost::unordered::detail::emplace_args3, boost::tuples::tuple<> >; NodeAlloc =
std::allocator > >]'
/usr/include/boost/unordered/detail/unique.hpp:386:13: required from
'boost::unordered::detail::table_impl<Types>::value_type&
boost::unordered::detail::table_impl<Types>::operator[](const key_type&)
[with Types = boost::unordered::detail::map >,
Bitral::ConstantMemoryAddress, Bitral::CodeRegion*,
boost::hashBitral::ConstantMemoryAddress,
std::equal_toBitral::ConstantMemoryAddress >;
boost::unordered::detail::table_impl<Types>::value_type = std::pair;
boost::unordered::detail::table_impl<Types>::key_type =
Bitral::ConstantMemoryAddress]'
/usr/include/boost/unordered/unordered_map.hpp:1196:26: required from
'boost::unordered::unordered_map::mapped_type&
boost::unordered::unordered_map::operator[](const key_type&)
[with K = Bitral::ConstantMemoryAddress; T = Bitral::CodeRegion*; H =
boost::hashBitral::ConstantMemoryAddress; P =
std::equal_toBitral::ConstantMemoryAddress; A =
std::allocator >; boost::unordered::unordered_map::mapped_type = Bitral::CodeRegion*; boost::unordered::unordered_map::key_type = Bitral::ConstantMemoryAddress]'
/home/hades/Bitral/src/BitralContext.cpp:30:31: required from here
/usr/include/boost/unordered/detail/allocator_helpers.hpp:643:11: error:
exception handling disabled, use -fexceptions to enable
The strange thing is that compiling the code with CLANG 3.1 and exceptions
explicitly disabled works fine.
There is a way to make it work with exceptions disabled and G++?
Thanks
Marcello