Skip to content

Add functionality which allows create own convert function #16

@Tsygankov-Slava

Description

@Tsygankov-Slava

For example, we have class Point and we start program ./cli distance "1,2" "2,1"

class Point {
public:
    Point(int x, int y) : x(x), y(y) {};
    int x, y;
    static Point convert(const std::string& value) {
          int x, y;
          // code
          return {x, y};
    }
}

And we want to create convert function, which will convert "1,2" to (Point){1,2}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions