Improved error detection with invalid conversions in util::as<T>(...).