static IntType add(IntType x, IntType c) { if(c == 0) return x; else if(c <= traits::const_max - m) // i.e. m+c < max return add_small(x, c); else return detail::do_add<traits::is_signed>::add(m, x, c); }
static IntType add(IntType x, IntType c) { if(c == 0) return x; else if(c <= traits::const_max - m) // i.e. m+c < max return add_small(x, c); else if(traits::is_signed) return add_signed(x, c); else { // difficult assert(!"const_mod::add with c too large"); return 0; } }