Opened 4 years ago

Last modified 4 years ago

#13607 new Bugs

Asio bad_address_cast fix under no exceptions

Reported by: kvankooten Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: chriskohlhoff

Description

When using the Asio module in MSVC when exceptions are disabled, deriving an exception from bad_cast throws a linker error. A simple fix would look similar to the lexical_cast, bad_any_cast, etc.

Change History (1)

comment:1 by kvankooten@…, 4 years ago

The class bad_adress_cast in bad_address_cast.hpp can be derived as follows:

class bad_address_cast :
#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS 
        public std::exception 
#else 
        public std::bad_cast 
#endif
{
...
}
Note: See TracTickets for help on using tickets.