Skip to content
Snippets Groups Projects
Commit 156bf5db authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

bigunsignedint: Throw an exception when constructing from a negative integer.

parent 7d2a12f8
No related branches found
No related tags found
No related merge requests found
......@@ -162,8 +162,9 @@ namespace Dune
template<typename Signed>
bigunsignedint<k>::bigunsignedint (Signed y, typename std::enable_if<std::is_integral<Signed>::value && std::is_signed<Signed>::value>::type*)
{
std::uintmax_t x = std::abs(y);
assign(x);
if (y < 0)
DUNE_THROW(Dune::Exception, "Trying to construct a Dune::bigunsignedint from a negative integer: " << y);
assign(y);
}
template<int k>
......
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