Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __NULLPTR98_H__
- #define __NULLPTR98_H__
- #if __cplusplus == 199711L
- namespace std {
- class nullptr_t {
- public:
- // приводится к любому типу
- template<class T> operator T*() const {
- return 0;
- }
- template<class C, class T> operator T C::*() const {
- return 0;
- }
- private:
- // адрес скрыт
- void operator&() const;
- };
- }
- // объявляем в глобальной зоне видимости
- std::nullptr_t nullptr = {};
- #endif // __cplusplus
- #endif // __NULLPTR98_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement