Feature #23653
Add optional parameters to report an std::optional value
Status:
Under Discussion
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11/25/2019
Due date:
% Done:
0%
Estimated time:
Description
This request is to add something of the like of:
std::optional<value_type> operator() () const
to fhicl::OptionalAtom
, fhicl::OptionalSequence
and fhicl::OptionalTable
to return the optional value wrapped in a C++ optional
data type.This has the advantage of uniforming the interface with the non-optional parameters and to allow an easy initialization of data member from the configuration directly in the initialization list inside a constructor, with the added bonus of the ability to supply a default value via
std::optional::value_or()
.
History
#1 Updated by Kyle Knoepfel over 1 year ago
- Status changed from New to Under Discussion
Seems like a reasonable suggestion, but it will take some analysis.