by Anonymous » 03 Apr 2025, 10:19
Code: Select all
#include
#include
struct my_struct {
const std::tuple t{5, 3.14};
template
decltype(std::get(t)) get() {
return std::get(t);
}
};
namespace std {
template
struct tuple_size :
integral_constant<
std::size_t,
std::tuple_size_v> {
};
template
struct tuple_element {
using type = tuple_element_t<
i,
decltype(std::declval().t)>;
};
}
int main() {
my_struct s;
auto [x, y] = s;
std::cout
[code]#include
#include
struct my_struct {
const std::tuple t{5, 3.14};
template
decltype(std::get(t)) get() {
return std::get(t);
}
};
namespace std {
template
struct tuple_size :
integral_constant<
std::size_t,
std::tuple_size_v> {
};
template
struct tuple_element {
using type = tuple_element_t<
i,
decltype(std::declval().t)>;
};
}
int main() {
my_struct s;
auto [x, y] = s;
std::cout