template<typename Concept, std::size_t Len, std::size_t Align>
class entt::basic_poly< Concept, Len, Align >
Static polymorphism made simple and within everyone's reach.
Static polymorphism is a very powerful tool in C++, albeit sometimes cumbersome to obtain.
This class aims to make it simple and easy to use.
- Note
- Both deduced and defined static virtual tables are supported.
Moreover, the poly class template also works with unmanaged objects.
- Template Parameters
-
| Concept | Concept descriptor. |
| Len | Size of the storage reserved for the small buffer optimization. |
| Align | Optional alignment requirement. |
Definition at line 181 of file poly.hpp.
template<typename Concept , std::size_t Len, std::size_t Align>
template<typename Type , typename... Args>
Constructs a poly by directly initializing the new object.
- Template Parameters
-
| Type | Type of object to use to initialize the poly. |
| Args | Types of arguments to use to construct the new instance. |
- Parameters
-
| args | Parameters to use to construct the instance. |
Definition at line 204 of file poly.hpp.
template<typename Concept , std::size_t Len, std::size_t Align>
template<typename Type , typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, basic_poly>>>
Constructs a poly from a given value.
- Template Parameters
-
| Type | Type of object to use to initialize the poly. |
- Parameters
-
| value | An instance of an object to use to initialize the poly. |
Definition at line 215 of file poly.hpp.
template<typename Concept , std::size_t Len, std::size_t Align>
template<typename Type , typename... Args>
Replaces the contained object by creating a new instance directly.
- Template Parameters
-
| Type | Type of object to use to initialize the poly. |
| Args | Types of arguments to use to construct the new instance. |
- Parameters
-
| args | Parameters to use to construct the instance. |
Definition at line 273 of file poly.hpp.