- 
                Notifications
    You must be signed in to change notification settings 
- Fork 397
Closed
Labels
triageNeeds verification before next releaseNeeds verification before next release
Description
Consider following code:
All works fine with C++14 & C++17.
But failed to call my function in C++20.
Tested under Visual Studio 16.9.0 with "/std:c++latest".
#include <CLI/App.hpp>
#include <CLI/CLI.hpp>
#include <iostream>
#include <sstream>
template <class T = int>
struct Values
{
    T a;
    T b;
    T c;
};
using DoubleValues = Values<double>;
namespace CLI
{
auto &&operator>>(std::istringstream &in, Values<double> &v)
{
    std::string input;
    in >> input;
    std::cout
        << "called correct function " __FUNCTION__ " ! "
                                                   "val: "
        << input << std::endl;
    return in;
}
bool lexical_cast(const std::string &input,
                  Values<double> &v)
{
    std::cout
        << "called correct function " __FUNCTION__ " ! "
                                                   "val: "
        << input << std::endl;
    return true;
}
};// namespace CLI
DoubleValues doubles;
void argparse(CLI::Option_group *group)
{
    group->add_option("--fee-rate", doubles)
        ->envname("FEE_RATE")
        ->default_str("0");
}
int main(int argc, char **argv)
{
    CLI::App app;
    argparse(app.add_option_group("param"));
    CLI11_PARSE(app, argc, argv);
    return 0;
}
Metadata
Metadata
Assignees
Labels
triageNeeds verification before next releaseNeeds verification before next release