15#ifndef LIEF_CAN_BE_UNIQUE_H
16#define LIEF_CAN_BE_UNIQUE_H
34 std::swap(ptr_, other.ptr_);
35 owned_ = other.owned_;
40 std::swap(ptr_, other.ptr_);
41 owned_ = other.owned_;
52 ptr_(const_cast<T*>(&ptr)),
57 ptr_(unique_ptr.release()),
65 const T*
get()
const {
89 if (ptr_ !=
nullptr) {
95 operator bool()
const {
96 return ptr_ !=
nullptr;
Definition canbe_unique.hpp:22
~canbe_unique()
Definition canbe_unique.hpp:99
canbe_unique & operator=(std::nullptr_t)
Definition canbe_unique.hpp:28
T * operator->()
Definition canbe_unique.hpp:69
void reset()
Definition canbe_unique.hpp:85
const T & operator*() const
Definition canbe_unique.hpp:81
T & operator*()
Definition canbe_unique.hpp:77
const T * operator->() const
Definition canbe_unique.hpp:73
canbe_unique & operator=(canbe_unique &&other) noexcept
Definition canbe_unique.hpp:38
const T * get() const
Definition canbe_unique.hpp:65
canbe_unique(const canbe_unique &)=delete
canbe_unique(T &ptr)
Definition canbe_unique.hpp:46
canbe_unique(canbe_unique &&other) noexcept
Definition canbe_unique.hpp:33
canbe_unique(std::unique_ptr< T > unique_ptr)
Definition canbe_unique.hpp:56
canbe_unique & operator=(const canbe_unique &)=delete
canbe_unique(const T &ptr)
Definition canbe_unique.hpp:51
T * get()
Definition canbe_unique.hpp:61
bool operator==(const canbe_unique< T > &lhs, std::nullptr_t)
Definition canbe_unique.hpp:109
LIEF namespace.
Definition Abstract/Binary.hpp:32