HElib  1.0
Implementing Homomorphic Encryption
 All Classes Files Functions Variables Friends Pages
Classes | Macros
cloned_ptr.h File Reference

Implemenation of smart pointers with "deep cloning" semantics. More...

Go to the source code of this file.

Classes

class  deep_clone< X >
 Deep copy: initialize with clone. More...
 
class  shallow_clone< X >
 Shallow copy: initialize with copy constructor. More...
 

Macros

#define CLONED_PTR_TEMPLATE_MEMBERS(CLONED_PTR_TYPE)
 
#define CLONED_PTR_DECLARE(CLONED_PTR_TYPE, CLONED_PTR_INIT)
 

Detailed Description

Implemenation of smart pointers with "deep cloning" semantics.

Based (loosely) on code from

http://github.com/yonat/smart_ptr/blob/master/cloned_ptr.h

Macro Definition Documentation

#define CLONED_PTR_TEMPLATE_MEMBERS (   CLONED_PTR_TYPE)
Value:
\
template <class Y> CLONED_PTR_TYPE(const CLONED_PTR_TYPE<Y>& r) \
{copy(r.ptr);} \
template <class Y> CLONED_PTR_TYPE& operator=(const CLONED_PTR_TYPE<Y>& r) \
{ \
if (this != &r) { \
delete ptr; \
copy(r.ptr); \
} \
return *this; \
} \