void assert_type_equal(type_id want, type_id got) { if (want != got) throw make_conversion_error(want, got); }
void scalar_base::ok(pn_type_t t) const { if (atom_.type != t) throw make_conversion_error(type_id(t), type()); }