Go to the documentation of this file.
18 #ifndef CARLA_CPP_COMPAT_HPP_INCLUDED
19 #define CARLA_CPP_COMPAT_HPP_INCLUDED
21 #include "CarlaDefines.h"
23 #ifdef CARLA_PROPER_CPP11_SUPPORT
27 # include "CarlaUtils.hpp"
32 #ifndef CARLA_PROPER_CPP11_SUPPORT
66 pn =
new volatile long(1);
68 catch (std::bad_alloc&)
130 CARLA_SAFE_ASSERT_RETURN(
nullptr == ptr.px || 0 != ptr.pn.use_count(),);
138 CARLA_SAFE_ASSERT_RETURN(
nullptr == ptr.px || 0 != ptr.pn.use_count(),);
160 std::swap(px, lhs.px);
164 operator bool() const noexcept
182 T*
get(
void)
const noexcept
194 void release(
void) noexcept
211 return (l.get() == r.get());
215 return (l.get() != r.get());
219 return (l.get() <= r.get());
223 return (l.get() < r.get());
227 return (l.get() >= r.get());
231 return (l.get() > r.get());
233 template<
class T,
class U>
238 template<
class T,
class U>
254 return static_cast<T*
>(pointer1) == pointer2;
259 return static_cast<T*
>(pointer1) != pointer2;
263 #endif // CARLA_PROPER_CPP11_SUPPORT
265 CARLA_BACKEND_START_NAMESPACE
269 CARLA_BACKEND_END_NAMESPACE
273 #endif // CARLA_CPP_COMPAT_HPP_INCLUDED
bool operator<(const shared_ptr< T > &l, const shared_ptr< U > &r) noexcept
Definition: CarlaPluginPtr.hpp:221
bool operator>(const shared_ptr< T > &l, const shared_ptr< U > &r) noexcept
Definition: CarlaPluginPtr.hpp:229
shared_ptr_count()
Definition: CarlaPluginPtr.hpp:43
volatile long * pn
Definition: CarlaPluginPtr.hpp:97
shared_ptr & operator=(shared_ptr ptr) noexcept
Definition: CarlaPluginPtr.hpp:142
bool operator==(const shared_ptr< T > &l, const shared_ptr< U > &r) noexcept
Definition: CarlaPluginPtr.hpp:209
Definition: CarlaPluginPtr.hpp:101
long use_count(void) const noexcept
Definition: CarlaPluginPtr.hpp:47
void release(U *p) noexcept
Definition: CarlaPluginPtr.hpp:82
T * get(void) const noexcept
Definition: CarlaPluginPtr.hpp:182
~shared_ptr(void) noexcept
Definition: CarlaPluginPtr.hpp:148
T & operator*() const noexcept
Definition: CarlaPluginPtr.hpp:174
void acquire(U *p)
Definition: CarlaPluginPtr.hpp:58
T element_type
Definition: CarlaPluginPtr.hpp:104
void swap(shared_ptr_count &lhs) noexcept
Definition: CarlaPluginPtr.hpp:45
shared_ptr(T *p)
Definition: CarlaPluginPtr.hpp:110
shared_ptr(void) noexcept
Definition: CarlaPluginPtr.hpp:106
long use_count(void) const noexcept
Definition: CarlaPluginPtr.hpp:168
shared_ptr< T > static_pointer_cast(const shared_ptr< U > &ptr)
Definition: CarlaPluginPtr.hpp:234
bool operator!=(const shared_ptr< T > &l, const shared_ptr< U > &r) noexcept
Definition: CarlaPluginPtr.hpp:213
Definition: CarlaPluginPtr.hpp:33
bool operator<=(const shared_ptr< T > &l, const shared_ptr< U > &r) noexcept
Definition: CarlaPluginPtr.hpp:217
void reset(void) noexcept
Definition: CarlaPluginPtr.hpp:153
Definition: CarlaPluginPtr.hpp:40
shared_ptr< T > dynamic_pointer_cast(const shared_ptr< U > &ptr)
Definition: CarlaPluginPtr.hpp:239
void swap(shared_ptr &lhs) noexcept
Definition: CarlaPluginPtr.hpp:158
shared_ptr(const shared_ptr< U > &ptr) noexcept
Definition: CarlaPluginPtr.hpp:126
CARLA_BACKEND_START_NAMESPACE typedef std::shared_ptr< CarlaPlugin > CarlaPluginPtr
Definition: CarlaPluginPtr.hpp:267
bool operator>=(const shared_ptr< T > &l, const shared_ptr< U > &r) noexcept
Definition: CarlaPluginPtr.hpp:225
shared_ptr_count(const shared_ptr_count &count)
Definition: CarlaPluginPtr.hpp:44
shared_ptr(const shared_ptr &ptr) noexcept
Definition: CarlaPluginPtr.hpp:134
T * operator->() const noexcept
Definition: CarlaPluginPtr.hpp:178
shared_ptr(const shared_ptr< U > &ptr, T *p)
Definition: CarlaPluginPtr.hpp:118