feat(option_utils): add withDefault utility for Boost program options

This commit is contained in:
Ваше Имя
2025-10-04 17:09:41 +04:00
parent ba91359db3
commit 827cc07175
2 changed files with 22 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#pragma once
#include <boost/program_options.hpp>
class OptionUtils
{
protected:
OptionUtils() = default;
~OptionUtils() = default;
template <typename T> static auto withDefault(T value);
};
#include "option_utils.tpp"
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include "option_utils.hpp"
template <typename T> auto OptionUtils::withDefault(T value)
{
return boost::program_options::value<T>()->default_value(value);
}