mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-08-04 02:06:29 -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.
|
* Constructor.
|
||||||
* \param allowed - vector of allowed values.
|
* \param allowed - vector of allowed values.
|
||||||
*/
|
*/
|
||||||
ValuesConstraint(std::vector<T>& allowed);
|
ValuesConstraint(std::vector<T>const& allowed);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Virtual destructor.
|
* Virtual destructor.
|
||||||
@ -89,7 +89,7 @@ class ValuesConstraint : public Constraint<T>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
ValuesConstraint<T>::ValuesConstraint(std::vector<T>& allowed)
|
ValuesConstraint<T>::ValuesConstraint(std::vector<T> const& allowed)
|
||||||
: _allowed(allowed),
|
: _allowed(allowed),
|
||||||
_typeDesc("")
|
_typeDesc("")
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user