same with these casts.

in fact, you could just do a try/catch around a boost numeric cast and translate the exception to InvalidUnpackException. But insofar as logic errors, this looks clean to me.