Skip to content

Add a move constructor (may not work) #268

Open
@ghost

Description

So I'm trying to return my app from a function instead of doing everything in main for testing purposes. But when I return the CLI::App instance from the function, I get an error.

Steps to reproduce:

#include <CLI/CLI.hpp>

CLI::App get_app() {
    CLI::App app { "CLI App"};
    return app;
}

int main(int argc, char **argv) {
    auto app = get_app();

    CLI11_PARSE(app, argc, argv);
}

I couldn't find the copy constructor defined anywhere, is that the problem? I know when a destructor is custom-defined, the default copy constructor is not included. Please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions