You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::variant<std::string, int> house;
house = 221;
std::visit([] (const auto &arg) {
using T = std::decay_tstd::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);
The text was updated successfully, but these errors were encountered:
This error gives a error:
#include
std::variant<std::string, int> house;
house = 221;
std::visit([] (const auto &arg) {
using T = std::decay_tstd::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);
The text was updated successfully, but these errors were encountered: