Created
August 17, 2020 06:08
-
-
Save yohhoy/7b63eafcc42e078f34294857698adfd9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
int main() { | |
int x = 42; | |
static_assert(std::is_same_v<decltype( x ), int>); | |
static_assert(std::is_same_v<decltype((x)), int&>); | |
int (y) = 42; // redundant parentheses | |
static_assert(std::is_same_v<decltype( y ), int>); | |
static_assert(std::is_same_v<decltype((y)), int&>); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment