Untitled

 avatar
unknown
c_cpp
3 years ago
249 B
1
Indexable
#include <variant>
#include <string>

using std::variant;
using std::string;
using std::get;

int subtract(int x, int y) {
        variant<int, string> vx, vy;
        vx = x;
        vy = y;
        return get<int>(vx) - get<int>(vy);
}
Editor is loading...