9#ifndef _fei_SharedPtr_hpp_
10#define _fei_SharedPtr_hpp_
12#include <fei_macros.hpp>
111#if !defined( FEI_NO_MEMBER_TEMPLATES )
125 ++*(count = x.count);
146 share(x.pointer,x.count);
163 ++*(count = x.count);
182 share(x.pointer, x.count);
204 if ( pointer == p )
return;
242 T*
get()
const {
return pointer; }
258 bool unique()
const {
return *count == 1; }
261 void share(T* xpointer,
long* xcount) {
262 if (count != xcount) {
280#if defined( FEI_NO_MEMBER_TEMPLATES ) || !defined( FEI_NO_MEMBER_TEMPLATES )
287#if !defined( FEI_NO_MEMBER_TEMPLATES ) && !defined( FEI_NO_MEMBER_TEMPLATES )
288 template<
typename Y>
friend class SharedPtr;
296template<
typename T,
typename U>
298 {
return a.
get() == b.
get(); }
303template<
typename T,
typename U>
305 {
return a.
get() != b.
get(); }
SharedPtr & operator=(const SharedPtr &x)
SharedPtr & operator=(const SharedPtr< Y > &x)
SharedPtr(const SharedPtr &x)
SharedPtr(const SharedPtr< Y > &x)
void share(T *xpointer, long *xcount)
bool operator==(const SharedPtr< T > &a, const SharedPtr< U > &b)
bool operator!=(const SharedPtr< T > &a, const SharedPtr< U > &b)