24#ifndef quantlib_clone_hpp
25#define quantlib_clone_hpp
51 T* operator->() const;
72 :
ptr_(
t.clone().release()) {}
76 : ptr_(
t.empty() ? (
T*)nullptr :
t->clone().release()) {}
91 ptr_.reset(
t.empty() ? (
T*)
nullptr :
t->clone().release());
103 QL_REQUIRE(!this->empty(),
"no underlying objects");
104 return *(this->ptr_);
109 return this->ptr_.get();
119 this->ptr_.swap(
t.ptr_);
cloning proxy to an underlying object
Clone(std::unique_ptr< T > &&)
Clone(Clone< T > &&) noexcept
std::unique_ptr< T > ptr_
Clone< T > & operator=(const T &)
void swap(Clone< T > &t) noexcept
Clone(const Clone< T > &)
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
void swap(Array &v, Array &w) noexcept