Skip to content

clipp::option and clipp::group initialization issue #81

@robabateman

Description

@robabateman

Consider this code:
https://github.com/muellan/clipp/blob/master/examples/options.cpp#L23
Here's the code for context:

    auto cli = (
        option("-a").set(a)                  % "activates a",
        option("-b").set(b)                  % "activates b",
        option("-c", "--noc").set(c,false)   % "deactivates c",
        option("--hi")([]{cout << "hi!\n";}) % "says hi");

Effectively what we have here is:

auto cli = (expr1, expr2, expr3, expr4);

This generates the following level 1 compiler warning under visual C++ for example:

warning C4548: expression before comma has no effect; expected expression with side-effect

I assume this is just an oversight in the examples?
So, is there any advice on the correct way to initialize a group from a set of options?

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