Skip to content
Snippets Groups Projects
Commit c485c910 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[numeric_cast] fix dangerously hardcoded wrong type

parent e2a3cc5f
No related branches found
No related tags found
No related merge requests found
......@@ -19,12 +19,12 @@ T numeric_cast(S source)
{
T target;
try {
target = boost::numeric_cast<size_t>(source);
target = boost::numeric_cast<T>(source);
} catch (boost::bad_numeric_cast& ee) {
DUNE_THROW(XT::Common::Exceptions::external_error,
" The following error occured in boost while converting '" << source << "' to '"
<< XT::Common::Typename<size_t>::value()
<< ":\n\n"
<< "':\n\n "
<< ee.what());
}
return target;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment