What are the uses of the type `std::nullptr_t`?

前端 未结 3 1194
再見小時候
再見小時候 2021-01-01 13:38

I learned that nullptr, in addition to being convertible to any pointer type (but not to any integral type) also has its own type std::nullptr_t. S

3条回答
  •  攒了一身酷
    2021-01-01 13:49

    Also, what other type would you give it, that doesn't simply re-introduce the problems we had with NULL? The whole point is to get rid of the nasty implicit conversions, but we can't actually change behaviour of old programs so here we are.

提交回复
热议问题