kblib 0.2.3
General utilities library for modern C++
|
poly_obj_traits is a traits class template which abstracts the allowed operations on a polymorphic type hierarchy. Any operation allowed by the traits must be usable for the entire hierarchy, not just the base class. More...
#include <kblib/poly_obj.h>
Public Types | |
using | copy_t = default_copy< Obj, copyable > |
Implements type erasure for copy construction. More... | |
using | move_t = default_move< Obj, movable, nothrow_movable, copyable > |
Implements type erasure for move construction. More... | |
using | destroy_t = default_destroy< Obj > |
Implements type erasure for destruction. The default implementation requires and always uses virtual dispatch for destruction. More... | |
Static Public Attributes | |
static constexpr std::size_t | default_capacity = detail_poly::extract_derived_size<Obj>::value |
The default capacity to use if not overridden. More... | |
static constexpr std::size_t | alignment = std::max(alignof(Obj), alignof(std::max_align_t)) |
How much to align the storage by. More... | |
static constexpr bool | copyable = detail_poly::copyable(CType) |
If the object is copy constructible. More... | |
static constexpr bool | movable = detail_poly::movable(CType) |
If the object is move constructible. More... | |
static constexpr bool | nothrow_movable = detail_poly::nothrow_movable(CType) |
If the object is nothrow move constructible. More... | |
poly_obj_traits is a traits class template which abstracts the allowed operations on a polymorphic type hierarchy. Any operation allowed by the traits must be usable for the entire hierarchy, not just the base class.
Users of poly_obj may provide explicit specializations of this type, as long as they satisfy all the requirements listed here. Alternatively, users may write their own traits types, subject to the same restrictions.
Definition at line 374 of file poly_obj.h.
using kblib::poly_obj_traits< Obj, CType >::copy_t = default_copy<Obj, copyable> |
Implements type erasure for copy construction.
Must be assignable. If copying is enabled, copy_t must have:
Definition at line 417 of file poly_obj.h.
using kblib::poly_obj_traits< Obj, CType >::destroy_t = default_destroy<Obj> |
Implements type erasure for destruction. The default implementation requires and always uses virtual dispatch for destruction.
Must be assignable. Must have:
Definition at line 447 of file poly_obj.h.
using kblib::poly_obj_traits< Obj, CType >::move_t = default_move<Obj, movable, nothrow_movable, copyable> |
Implements type erasure for move construction.
Must be assignable. If moving is enabled, move_t must have:
Definition at line 432 of file poly_obj.h.
|
staticconstexpr |
How much to align the storage by.
Definition at line 388 of file poly_obj.h.
|
staticconstexpr |
If the object is copy constructible.
Definition at line 394 of file poly_obj.h.
|
staticconstexpr |
The default capacity to use if not overridden.
The default implementation uses Obj::max_derived_size if it exists, or sizeof(Obj) otherwise.
Definition at line 382 of file poly_obj.h.
|
staticconstexpr |
If the object is move constructible.
Definition at line 399 of file poly_obj.h.
|
staticconstexpr |
If the object is nothrow move constructible.
Definition at line 403 of file poly_obj.h.