jupyter-xeus / xeus-cling

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
3.01k stars 294 forks source link

std::visit does not work with lambda #511

Open arturo-salinas opened 6 months ago

arturo-salinas commented 6 months ago

This error gives a error:

include

std::variant<std::string, int> house; house = 221; std::visit([] (const auto &arg) { using T = std::decay_t<std::decltype(arg)>; if constexpr (std::is_same_v<T, std::string>) { std::cout << "A house called " << arg << "\n"; } else { std::cout << "House number is " << arg << "\n"; } },house);