Namespaces
Variants

std::polymorphic<T, Allocator>:: operator->, std::polymorphic<T, Allocator>:: operator*

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
constexpr const_pointer operator - > ( ) const noexcept ;
(1) (desde C++26)
constexpr pointer operator - > ( ) noexcept ;
(2) (desde C++26)
constexpr const T & operator * ( ) const & noexcept ;
(3) (desde C++26)
constexpr T & operator * ( ) & noexcept ;
(4) (desde C++26)

Accede al valor poseído.

1,2) Devuelve un puntero al valor poseído.
3,4) Devuelve una referencia al valor poseído.

Si * this no tiene valor, el comportamiento es indefinido.

Valor de retorno

Como se describió anteriormente.

Notas

Este operador no verifica si * this carece de valor, los usuarios pueden hacerlo manualmente usando valueless_after_move() .

Ejemplo