Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
boost::numeric_cast is a safe number conversion function that throws an exception if the conversion cannot succeed.
In the example below, the highest possible int is converted to a short. Because this will fail, boost::numeric_cast throws an exception.
#include <boost/static_assert.hpp> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.