2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
2009-01-28 20:55:45 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#ifndef __SPTR_HH_INCLUDED__
|
|
|
|
#define __SPTR_HH_INCLUDED__
|
|
|
|
|
2022-01-09 08:18:55 +00:00
|
|
|
// using std::shared_ptr
|
2009-01-28 20:55:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
template< class T >
|
2022-01-09 08:18:55 +00:00
|
|
|
class sptr: public std::shared_ptr< T >
|
2009-01-28 20:55:45 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
sptr() {}
|
|
|
|
|
2022-01-09 08:18:55 +00:00
|
|
|
sptr( T * p ): std::shared_ptr< T >( p ) {}
|
2009-01-28 20:55:45 +00:00
|
|
|
|
|
|
|
// TT is meant to be a derivative of T
|
|
|
|
template< class TT >
|
2022-01-09 08:18:55 +00:00
|
|
|
sptr( sptr< TT > const & other ): std::shared_ptr< T >( other ) {}
|
2009-01-28 20:55:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|