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 | db43368da1171b57f434d86bbea4327fd0113715 (patch) | |
tree | abbadb058033c8f215b2d4b178606df302685e8c | |
parent | 74f28e6c6fad7c4b75d97dcc239d29df04e525cb (diff) | |
download | ydb-db43368da1171b57f434d86bbea4327fd0113715.tar.gz |
Restoring authorship annotation for <lo-r-d@yandex-team.ru>. Commit 1 of 2.
-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 a8dd5adca9..e78678d178 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) { |