QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Related Functions | List of all members
Clone< T > Class Template Reference

cloning proxy to an underlying object More...

#include <clone.hpp>

+ Inheritance diagram for Clone< T >:
+ Collaboration diagram for Clone< T >:

Public Member Functions

 Clone ()=default
 
 Clone (std::unique_ptr< T > &&)
 
 Clone (const T &)
 
 Clone (const Clone< T > &)
 
 Clone (Clone< T > &&) noexcept
 
Clone< T > & operator= (const T &)
 
Clone< T > & operator= (const Clone< T > &)
 
Clone< T > & operator= (Clone< T > &&) noexcept
 
Toperator* () const
 
Toperator-> () const
 
bool empty () const
 
void swap (Clone< T > &t) noexcept
 
 ~Clone ()=default
 

Private Attributes

std::unique_ptr< Tptr_
 

Related Functions

(Note that these are not member functions.)

template<class T >
void swap (Clone< T > &, Clone< T > &) noexcept
 

Detailed Description

template<class T>
class QuantLib::Clone< T >

cloning proxy to an underlying object

When copied, this class will make a clone of its underlying object, which must provide a clone() method returning a std::auto_ptr (or a std::unique_ptr, depending on your configuration) to a newly-allocated instance.

Examples
MarketModels.cpp.

Definition at line 40 of file clone.hpp.

Constructor & Destructor Documentation

◆ Clone() [1/5]

Clone ( )
default

◆ Clone() [2/5]

Clone ( std::unique_ptr< T > &&  p)

Definition at line 67 of file clone.hpp.

◆ Clone() [3/5]

Clone ( const T t)

Definition at line 71 of file clone.hpp.

◆ Clone() [4/5]

Clone ( const Clone< T > &  t)

Definition at line 75 of file clone.hpp.

◆ Clone() [5/5]

Clone ( Clone< T > &&  t)
noexcept

Definition at line 79 of file clone.hpp.

+ Here is the call graph for this function:

◆ ~Clone()

~Clone ( )
default

Member Function Documentation

◆ operator=() [1/3]

Clone< T > & operator= ( const T t)

Definition at line 84 of file clone.hpp.

◆ operator=() [2/3]

Clone< T > & operator= ( const Clone< T > &  t)

Definition at line 90 of file clone.hpp.

◆ operator=() [3/3]

Clone< T > & operator= ( Clone< T > &&  t)
noexcept

Definition at line 96 of file clone.hpp.

+ Here is the call graph for this function:

◆ operator*()

T & operator*

Definition at line 102 of file clone.hpp.

◆ operator->()

T * operator->

Definition at line 108 of file clone.hpp.

◆ empty()

bool empty

Definition at line 113 of file clone.hpp.

◆ swap()

void swap ( Clone< T > &  t)
noexcept

Definition at line 118 of file clone.hpp.

Friends And Related Function Documentation

◆ swap()

void swap ( Clone< T > &  ,
Clone< T > &   
)
related

Definition at line 123 of file clone.hpp.

Member Data Documentation

◆ ptr_

std::unique_ptr<T> ptr_
private

Definition at line 56 of file clone.hpp.