A polymorphic value‐type.

Synopsis

Declared in <mrdocs/ADT/Polymorphic.hpp>

template<class T>
class Polymorphic;

Types

Member Functions

Name

Description

Polymorphic [constructor]

Constructors

~Polymorphic [destructor]

Destructor

operator=

Assignment operators

operator*

Dereference operators

operator‐>

Member access operators

valueless_after_move

Friends

Name

Description

mrdocs::swap

mrdocs::nullable_traits

nullable_traits<T> defines how to treat a T as “nullable” without an external engaged bit.

Non-Member Functions

Name

Description

CompareDerived

Compares two polymorphic objects that have visit functions

innerType

Return the inner type.

innerType

Return the inner type.

innermostType

Return the innermost type.

innermostType

Return the innermost type.

operator<=>

Three‐way comparison operator

operator<=>

Three‐way comparison operator

operator<=>

Three‐way comparison operator

operator<=>

Three‐way comparison operator

operator<=>

Three‐way comparison operator

operator==

Equality operator

operator==

Equality operator

operator==

Equality operator

operator==

Equality operator

doc::isEmpty

Determine if the inline is empty

doc::isEmpty

Determine if the inline is empty

doc::ltrim

Removes leading whitespace from the inline element.

doc::ltrim

Removes leading whitespace from the block.

doc::operator<=>

Three‐way comparison operator

doc::operator<=>

Three‐way comparison operator

doc::operator==

Equality operator

doc::operator==

Equality operator

doc::rtrim

Removes trailing whitespace from the block.

doc::rtrim

Removes trailing whitespace from the inline element.

doc::trim

Removes leading and trailing whitespace from the block.

doc::trim

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