#include <iostream>
#include <type_traits>
int main() {
int x = 10;
// decltype(x) evaluates to 'int'
decltype(x) y = 20; // y is an int
// You can check the type at compile-time using std::is_same_v
if constexpr (std::is_same_v<decltype(y), int>) {
std::cout << "y is an integer!\n";
}
}
/*
run:
y is an integer!
*/