From df5303b06cc3f28567203ab1ff34a23780bf9b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCttner?= Date: Wed, 11 Sep 2019 11:05:12 +0200 Subject: [PATCH] Initialize ValueConstraint from const reference. This allows the following in post the c++11 world: ``` tclap::ValueConstraint constraints({"foo", "bar"}); ``` instead of ``` std::vector constraint_choices({"foo", "bar"}); tclap::ValueConstraint constraints(constraint_choices); ``` --- include/tclap/ValuesConstraint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tclap/ValuesConstraint.h b/include/tclap/ValuesConstraint.h index a234297..c9ca80a 100644 --- a/include/tclap/ValuesConstraint.h +++ b/include/tclap/ValuesConstraint.h @@ -50,7 +50,7 @@ class ValuesConstraint : public Constraint * Constructor. * \param allowed - vector of allowed values. */ - ValuesConstraint(std::vector& allowed); + ValuesConstraint(std::vectorconst& allowed); /** * Virtual destructor. @@ -89,7 +89,7 @@ class ValuesConstraint : public Constraint }; template -ValuesConstraint::ValuesConstraint(std::vector& allowed) +ValuesConstraint::ValuesConstraint(std::vector const& allowed) : _allowed(allowed), _typeDesc("") {