Skip to content

Constructing arg with a callable sometimes picks the wrong overload #94

@mknejp

Description

@mknejp

The constraints put on the constructors of bound_parser seem to be different from opt, as the latter works in all these scenarios.

Works:

lyra::arg([](std::string) {}, "hint");

Does not work:

auto f = [](std::string) {};
lyra::arg(f, "hint");
auto f = std::function<void(std::string)>{};
lyra::arg(f, "hint");

They both cause compile errors as they attempt to stream into/out of the function object.

https://godbolt.org/z/W8M7Tb687

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions