1 #ifndef fhiclcpp_types_OptionalTableAs_h 2 #define fhiclcpp_types_OptionalTableAs_h 19 template <
typename T,
typename Config>
20 class OptionalTableAs {
26 std::function<
bool()> maybeUse);
32 return std::make_optional(convert(*via));
64 std::string
const preface =
65 "N.B. The following table is converted to type:";
66 std::string
const name =
67 " '" + cet::demangle_symbol(
typeid(T).name()) +
"'";
68 std::string
const user_comment =
69 comment.
value.empty() ?
"" :
"\n\n" + comment.value;
71 std::ostringstream oss;
72 oss << preface <<
'\n' << name << user_comment;
74 return Comment{oss.str().c_str()};
81 template <
typename T,
typename Config>
86 template <
typename T,
typename Config>
91 template <
typename T,
typename Config>
94 std::function<
bool()> maybeUse)
Comment conversion_comment(Comment &&comment) const
OptionalTable< Config > tableObj_
OptionalTableAs(Name &&name)
bool operator()(T &result) const
std::optional< T > operator()() const