struct inputfieldsptr { x::ptr_cast subject; x::ptr_cast text; inline void validate_or_throw_exception() const { if (!subject) validation_failed("subject"); if (!text) validation_failed("text"); } static inline void validation_failed(const char *object_name) __attribute__((noreturn)) { throw EXCEPTION("Internal error: object \"" << object_name << "\" was not created."); } }; struct inputfields { x::w::input_field subject; x::w::input_field text; inputfields(const inputfieldsptr &p) : subject(p.subject), text(p.text) {} };