mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-29 16:09:30 +00:00
parent
503d5d0c8e
commit
f3d1f08c3b
62 changed files with 527 additions and 527 deletions
|
@ -58,20 +58,20 @@ namespace Catch {
|
|||
T* operator->() const { return m_p; }
|
||||
bool operator !() const { return m_p == NULL; }
|
||||
operator SafeBool::type() const { return SafeBool::makeSafe( m_p != NULL ); }
|
||||
|
||||
|
||||
private:
|
||||
T* m_p;
|
||||
};
|
||||
|
||||
|
||||
struct IShared : NonCopyable {
|
||||
virtual ~IShared();
|
||||
virtual void addRef() const = 0;
|
||||
virtual void release() const = 0;
|
||||
};
|
||||
|
||||
|
||||
template<typename T = IShared>
|
||||
struct SharedImpl : T {
|
||||
|
||||
|
||||
SharedImpl() : m_rc( 0 ){}
|
||||
|
||||
virtual void addRef() const {
|
||||
|
@ -81,10 +81,10 @@ namespace Catch {
|
|||
if( --m_rc == 0 )
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
mutable unsigned int m_rc;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#ifdef __clang__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue