|
Boost : |
Subject: Re: [boost] [program_options] implicit value and non-adjacent tokens
From: Benedek Thaler (thalerbenedek_at_[hidden])
Date: 2017-01-05 03:20:22
This is a possible fix (subject to typos) :
template <typename T>
struct greedy_implicit_value : public po::typed_value<T>
{
using base = po::typed_value<T>;
greedy_implicit_value(const T& value) : base(nullptr)
{
base::implicit_value(value);
}
bool adjacent_tokens_only() const override { return false; }
unsigned max_tokens() const override { return 1; }
};
template <typename T>
po::typed_value* implicit_value(const T& value)
{
return new greedy_implicit_value<T>(value);
}
Benedek
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk