-
Notifications
You must be signed in to change notification settings - Fork 4
Description
This issue has been migrated from https://cdcvs.fnal.gov/redmine/issues/17964 (FNAL account required)
Originally created by @PetrilloAtWork on 2017-10-19 14:33:44
Using a fhicl::Sequence<std::string> names in my configuration structure, which was conditionally enabled and with no default value.
When names is disabled, a call names() returns a vector with a single empty string in it (of course, no value was provided from the configuration).
I am told this is the current expected behaviour, of initialising the container with a single, default-constructed element.
I would like to have:
- definition of what to expect from that value; "undefined" is also acceptable to me, although the expectation would have been an empty collection
- a way to determine if the atom, sequence or table was enabled; right now I can use
names.should_use()which seems to do the right thing, but it is undocumented and it's not clear whether it is considered part of the stable user interface
The quickest acceptable solution to me is to declare the content of the parameter undefined unless the parameter is enabled, and to have should_use() blessed for common use. I would though recommend a more user-friendly name for it (maybe enabled()... I am not good with names!).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status