A polymorphic value‐type.
Synopsis
Declared in <mrdocs/ADT/Polymorphic.hpp>
template<class T>
class Polymorphic;
Types
Member Functions
Name |
Description |
|
Constructors |
|
Destructor |
Assignment operators |
|
Dereference operators |
|
Member access operators |
|
Friends
Name |
Description |
nullable_traits<T> defines how to treat a T as “nullable” without an external engaged bit. |
Non-Member Functions
Name |
Description |
Compares two polymorphic objects that have visit functions |
|
Return the inner type. |
|
Return the inner type. |
|
Return the innermost type. |
|
Return the innermost type. |
|
Three‐way comparison operator |
|
Three‐way comparison operator |
|
Three‐way comparison operator |
|
Three‐way comparison operator |
|
Three‐way comparison operator |
|
Equality operator |
|
Equality operator |
|
Equality operator |
|
Equality operator |
|
Determine if the inline is empty |
|
Determine if the inline is empty |
|
Removes leading whitespace from the inline element. |
|
Removes leading whitespace from the block. |
|
Three‐way comparison operator |
|
Three‐way comparison operator |
|
Equality operator |
|
Equality operator |
|
Removes trailing whitespace from the block. |
|
Removes trailing whitespace from the inline element. |
|
Removes leading and trailing whitespace from the block. |
|
Removes leading and trailing whitespace from the inline element. |
Description
This class supports polymorphic objects with value‐like semantics.
It implements a tweaked version of std::polymorphic, based on the reference implementation for P3019R14. Differences are: It implements comparison operators with a very project‐specific design. Fixed allocator, not parametrizable. No initializer_list constructor.
Deep copies
To copy polymorphic objects, the class uses the copy constructor of the owned derived‐type object when copying to another value. Similarly, to allow the correct destruction of derived objects, it uses the destructor of the owned derived‐type object in the destructor.
Created with MrDocs