diff options
author | lo-r-d <lo-r-d@yandex-team.ru> | 2022-02-10 16:50:54 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:54 +0300 |
commit | 78c0028dbb79b03bcb0d700133245433b0dac3d1 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp | |
parent | db43368da1171b57f434d86bbea4327fd0113715 (diff) | |
download | ydb-78c0028dbb79b03bcb0d700133245433b0dac3d1.tar.gz |
Restoring authorship annotation for <lo-r-d@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/getopt/small/last_getopt_opt.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/getopt/small/last_getopt_opt.h b/library/cpp/getopt/small/last_getopt_opt.h index e78678d178..a8dd5adca9 100644 --- a/library/cpp/getopt/small/last_getopt_opt.h +++ b/library/cpp/getopt/small/last_getopt_opt.h @@ -620,18 +620,18 @@ namespace NLastGetopt { return StoreResultT<T>(target, def); } - template <typename T> - TOpt& StoreResultDef(T* target) { - DefaultValue_ = ToString(*target); - return StoreResultT<T>(target, *target); - } - - template <typename T, typename TpDef> - TOpt& StoreResultDef(T* target, const TpDef& def) { - DefaultValue_ = ToString(def); - return StoreResultT<T>(target, def); - } - + template <typename T> + TOpt& StoreResultDef(T* target) { + DefaultValue_ = ToString(*target); + return StoreResultT<T>(target, *target); + } + + template <typename T, typename TpDef> + TOpt& StoreResultDef(T* target, const TpDef& def) { + DefaultValue_ = ToString(def); + return StoreResultT<T>(target, def); + } + // Sugar for storing flags (option without arguments) to boolean vars TOpt& SetFlag(bool* target) { return DefaultValue("0").StoreResult(target, true); @@ -678,12 +678,12 @@ namespace NLastGetopt { return Handler1T<T>([target](auto&& value) { target->push_back(std::move(value)); }); } - // Appends FromString<T>(arg) to *target for each argument - template <typename T> - TOpt& InsertTo(THashSet<T>* target) { + // Appends FromString<T>(arg) to *target for each argument + template <typename T> + TOpt& InsertTo(THashSet<T>* target) { return Handler1T<T>([target](auto&& value) { target->insert(std::move(value)); }); - } - + } + // Emplaces TString arg to *target for each argument template <typename T> TOpt& EmplaceTo(TVector<T>* target) { |