Last active
November 26, 2017 16:13
-
-
Save yumetodo/bc30c51346bb4f0cc7f3c601d0c3490a 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
私は長い間nullptrの型はvoid*と思い込んで居たのですが、実は違います。 | |
nullptrの型はstd::nullptr_tとおなじになります。 | |
std::nullptr_tは、cstddefヘッダでtypedefされている型で、decltype(nullptr)の別名となっています。内部的な型名は決まっていません。 | |
decltypeは(後日解説予定ですが)C++11で追加された重要機能で引数の「型」を返します。つまり、decltype(nullptr)はnullptrの「型」です。そのまんまですね。(笑) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment