Skip to content

Custom parser supported? #443

Description

@Ecordonnier

Hi, is there support for adding a custom parser by manually specializing a template function?
E.g.;

struct Foobar {
...
};

template <>
const std::vector<Foobar> &cxxopts::OptionValue::as<std::vector<Foobar>>() const
{
...
}

foobar = parsed["foobar"].as<std::vector<Foobar>>();

I tried to specialize template <> T&cxxopts::OptionValue::as<T>() const in order to implement the custom parser, however it returns a reference so I guess it's not the proper way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions