SpECTRE  v2024.06.18
Options::Alternatives< AlternativeLists > Struct Template Reference

Provide multiple ways to construct a class. More...

#include <Options.hpp>

Detailed Description

template<typename... AlternativeLists>
struct Options::Alternatives< AlternativeLists >

Provide multiple ways to construct a class.

This type may be included in an option list along with option tags. When creating the class, the parser will choose one of the lists of options to use, depending on the user input.

The class must be prepared to accept any of the possible alternatives as arguments to its constructor. To disambiguate multiple alternatives with the same types, a constructor may take the full list of option tags expected as its first argument.

using options = tmpl::list<
A, Options::Alternatives<tmpl::list<B>, tmpl::list<C>, tmpl::list<D, E>>,
Alternatives(tmpl::list<A, B, F> /*meta*/, double a, int b, std::string f)
: a_(a), b_(b), f_(std::move(f)) {}
Alternatives(tmpl::list<A, C, F> /*meta*/, double a, int c, std::string f)
: a_(a), c_(c), f_(std::move(f)) {}
Alternatives(double a, std::vector<int> d, bool e, std::string f)
: a_(a), d_(std::move(d)), e_(e), f_(std::move(f)) {}
Provide multiple ways to construct a class.
Definition: Options.hpp:93

The documentation for this struct was generated from the following file: