mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-08-03 17:56:17 -04:00
Initialize ValueConstraint from const reference.
This allows the following in post the c++11 world: ``` tclap::ValueConstraint<std::string> constraints({"foo", "bar"}); ``` instead of ``` std::vector<std::string> constraint_choices({"foo", "bar"}); tclap::ValueConstraint<std::string> constraints(constraint_choices); ```
This commit is contained in:
parent
c51fb519d6
commit
df5303b06c
@ -50,7 +50,7 @@ class ValuesConstraint : public Constraint<T>
|
||||
* Constructor.
|
||||
* \param allowed - vector of allowed values.
|
||||
*/
|
||||
ValuesConstraint(std::vector<T>& allowed);
|
||||
ValuesConstraint(std::vector<T>const& allowed);
|
||||
|
||||
/**
|
||||
* Virtual destructor.
|
||||
@ -89,7 +89,7 @@ class ValuesConstraint : public Constraint<T>
|
||||
};
|
||||
|
||||
template<class T>
|
||||
ValuesConstraint<T>::ValuesConstraint(std::vector<T>& allowed)
|
||||
ValuesConstraint<T>::ValuesConstraint(std::vector<T> const& allowed)
|
||||
: _allowed(allowed),
|
||||
_typeDesc("")
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user