|
|
@@ -13,8 +13,6 @@
|
|
|
|
|
|
#include "pointer_fwd.hpp"
|
|
|
|
|
|
-#include "pointer_traits.hpp"
|
|
|
-
|
|
|
class null_pointer_exception : public std::invalid_argument {
|
|
|
using std::invalid_argument::invalid_argument;
|
|
|
};
|
|
|
@@ -24,9 +22,9 @@ template <typename P> class not_null<std::weak_ptr<P>>; // A weak_ptr cannot be
|
|
|
template <typename T>
|
|
|
class not_null {
|
|
|
public:
|
|
|
- using element_type = typename detail::pointer_traits<T>::element_type;
|
|
|
- using pointer = typename detail::pointer_traits<T>::pointer;
|
|
|
- using reference = typename detail::pointer_traits<T>::reference;
|
|
|
+ using element_type = typename std::pointer_traits<T>::element_type;
|
|
|
+ using pointer = element_type *;
|
|
|
+ using reference = element_type &;
|
|
|
|
|
|
explicit not_null(std::nullptr_t) = delete;
|
|
|
explicit not_null(int) = delete;
|