// // const_ptr.hpp // pointers // // Created by Sam Jaffe on 1/5/17. // #pragma once #include #include "pointer_fwd.hpp" #include "ptr_compare.hpp" template class const_ptr : private detail::get_ptr

{ public: using element_type = typename std::pointer_traits

::element_type; using pointer = element_type const *; using reference = element_type const &; const_ptr() noexcept : _ptr(nullptr) {} const_ptr(P const & p) noexcept(detail::is_nt_cc

::value) : _ptr(p) {} const_ptr(P && p) noexcept(detail::is_nt_mc

::value) : _ptr(std::move(p)) {} template ::value>::type> const_ptr(Y const & p) : _ptr(p) {} template ::value>::type> const_ptr(Y && p) : _ptr(std::forward(p)) {} template explicit operator const_ptr() const noexcept(detail::is_nt_c::value) { return _ptr; } operator bool() const noexcept { return static_cast(_ptr); } reference operator*() const noexcept(noexcept(*_ptr)) { return *_ptr; } pointer get() const noexcept(noexcept(detail::get_ptr

::get(_ptr))) { return detail::get_ptr

::get(_ptr); } pointer operator->() const noexcept(noexcept(get())) { return get(); } private: P _ptr; }; POINTER_TEMPLATE_COMPARE(const_ptr)