1 #ifndef IPFS_OBSERVER_PTR_H_
2 #define IPFS_OBSERVER_PTR_H_
4 #if __has_include("base/memory/raw_ptr.h")
5 #include "base/memory/raw_ptr.h"
9 using raw_ptr = base::raw_ptr<T>;
12 #elif defined(__has_cpp_attribute) && \
13 __has_cpp_attribute(__cpp_lib_experimental_observer_ptr)
14 #include <experimental/memory>
18 using raw_ptr = std::experimental::observer_ptr<T>;
46 T* get() {
return ptr_; }
47 T
const* get()
const {
return ptr_; }
48 explicit operator bool()
const {
return !!ptr_; }
49 T* operator->() {
return ptr_; }
50 T
const* operator->()
const {
return ptr_; }
Just an observing (non-owning) pointer.
Definition: raw_ptr.h:31