Project

General

Profile

Feature #23653

Add optional parameters to report an std::optional value

Added by Gianluca Petrillo 6 months ago. Updated 6 months ago.

Status:
Under Discussion
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11/25/2019
Due date:
% Done:

0%

Estimated time:
Duration:

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 6 months ago

  • Status changed from New to Under Discussion

Seems like a reasonable suggestion, but it will take some analysis.



Also available in: Atom PDF