KTL
ktl::shared< Alloc, Atomic > Class Template Reference

#include <shared.h>

Public Types

typedef detail::get_size_type_t< Alloc > size_type
 

Public Member Functions

template<typename A = Alloc>
 shared () noexcept(std::is_nothrow_default_constructible_v< block >)
 
template<typename... Args, typename = std::enable_if_t< std::is_constructible_v<Alloc, Args...>>>
 shared (Args &&... alloc) noexcept(std::is_nothrow_constructible_v< block, Args... >)
 Constructor for forwarding any arguments to the underlying allocator. More...
 
 shared (const shared &other) noexcept
 
 shared (shared &&other) noexcept
 
 ~shared ()
 
sharedoperator= (const shared &rhs) noexcept(noexcept(decrement()))
 
sharedoperator= (shared &&rhs) noexcept(noexcept(decrement()))
 
bool operator== (const shared &rhs) const noexcept(detail::has_nothrow_equal_v< Alloc >)
 
bool operator!= (const shared &rhs) const noexcept(detail::has_nothrow_not_equal_v< Alloc >)
 
void * allocate (size_t n) noexcept(detail::has_nothrow_allocate_v< Alloc >)
 
void deallocate (void *p, size_t n) noexcept(detail::has_nothrow_deallocate_v< Alloc >)
 
template<typename T , typename... Args>
std::enable_if< detail::has_construct_v< Alloc, T *, Args... >, void >::type construct (T *p, Args &&... args) noexcept(detail::has_nothrow_construct_v< Alloc, T *, Args... >)
 
template<typename T >
std::enable_if< detail::has_destroy_v< Alloc, T * >, void >::type destroy (T *p) noexcept(detail::has_nothrow_destroy_v< Alloc, T * >)
 
template<typename A = Alloc>
std::enable_if< detail::has_max_size_v< A >, size_type >::type max_size () const noexcept(detail::has_nothrow_max_size_v< A >)
 
template<typename A = Alloc>
std::enable_if< detail::has_owns_v< A >, bool >::type owns (void *p) const noexcept(detail::has_nothrow_owns_v< A >)
 
Alloc & get_allocator () noexcept
 
const Alloc & get_allocator () const noexcept
 

Member Typedef Documentation

◆ size_type

template<typename Alloc , template< typename > typename Atomic>
typedef detail::get_size_type_t<Alloc> ktl::shared< Alloc, Atomic >::size_type

Constructor & Destructor Documentation

◆ shared() [1/4]

template<typename Alloc , template< typename > typename Atomic>
template<typename A = Alloc>
ktl::shared< Alloc, Atomic >::shared ( )
inlinenoexcept

◆ shared() [2/4]

template<typename Alloc , template< typename > typename Atomic>
template<typename... Args, typename = std::enable_if_t< std::is_constructible_v<Alloc, Args...>>>
ktl::shared< Alloc, Atomic >::shared ( Args &&...  alloc)
inlineexplicitnoexcept

Constructor for forwarding any arguments to the underlying allocator.

◆ shared() [3/4]

template<typename Alloc , template< typename > typename Atomic>
ktl::shared< Alloc, Atomic >::shared ( const shared< Alloc, Atomic > &  other)
inlinenoexcept

◆ shared() [4/4]

template<typename Alloc , template< typename > typename Atomic>
ktl::shared< Alloc, Atomic >::shared ( shared< Alloc, Atomic > &&  other)
inlinenoexcept

◆ ~shared()

template<typename Alloc , template< typename > typename Atomic>
ktl::shared< Alloc, Atomic >::~shared ( )
inline

Member Function Documentation

◆ allocate()

template<typename Alloc , template< typename > typename Atomic>
void* ktl::shared< Alloc, Atomic >::allocate ( size_t  n)
inlinenoexcept

◆ construct()

template<typename Alloc , template< typename > typename Atomic>
template<typename T , typename... Args>
std::enable_if<detail::has_construct_v<Alloc, T*, Args...>, void>::type ktl::shared< Alloc, Atomic >::construct ( T *  p,
Args &&...  args 
)
inlinenoexcept

◆ deallocate()

template<typename Alloc , template< typename > typename Atomic>
void ktl::shared< Alloc, Atomic >::deallocate ( void *  p,
size_t  n 
)
inlinenoexcept

◆ destroy()

template<typename Alloc , template< typename > typename Atomic>
template<typename T >
std::enable_if<detail::has_destroy_v<Alloc, T*>, void>::type ktl::shared< Alloc, Atomic >::destroy ( T *  p)
inlinenoexcept

◆ get_allocator() [1/2]

template<typename Alloc , template< typename > typename Atomic>
const Alloc& ktl::shared< Alloc, Atomic >::get_allocator ( ) const
inlinenoexcept

◆ get_allocator() [2/2]

template<typename Alloc , template< typename > typename Atomic>
Alloc& ktl::shared< Alloc, Atomic >::get_allocator ( )
inlinenoexcept

◆ max_size()

template<typename Alloc , template< typename > typename Atomic>
template<typename A = Alloc>
std::enable_if<detail::has_max_size_v<A>, size_type>::type ktl::shared< Alloc, Atomic >::max_size ( ) const
inlinenoexcept

◆ operator!=()

template<typename Alloc , template< typename > typename Atomic>
bool ktl::shared< Alloc, Atomic >::operator!= ( const shared< Alloc, Atomic > &  rhs) const
inlinenoexcept

◆ operator=() [1/2]

template<typename Alloc , template< typename > typename Atomic>
shared& ktl::shared< Alloc, Atomic >::operator= ( const shared< Alloc, Atomic > &  rhs)
inlinenoexcept

◆ operator=() [2/2]

template<typename Alloc , template< typename > typename Atomic>
shared& ktl::shared< Alloc, Atomic >::operator= ( shared< Alloc, Atomic > &&  rhs)
inlinenoexcept

◆ operator==()

template<typename Alloc , template< typename > typename Atomic>
bool ktl::shared< Alloc, Atomic >::operator== ( const shared< Alloc, Atomic > &  rhs) const
inlinenoexcept

◆ owns()

template<typename Alloc , template< typename > typename Atomic>
template<typename A = Alloc>
std::enable_if<detail::has_owns_v<A>, bool>::type ktl::shared< Alloc, Atomic >::owns ( void *  p) const
inlinenoexcept

The documentation for this class was generated from the following file: