[ Web Proxy ]
URL:
Viewing: https://cppreference.com/cpp/memory/polymorphic/operator* [Back]  [Original]

std::polymorphic<T, Allocator>::operator->, std::polymorphic<T, Allocator>::operator* - cppreference.com
cppreference.com
Namespaces
Variants

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

From cppreference.com
 
 
Memory management library
Allocators
Memory resources
Uninitialized storage (until C++20*)
Garbage collector support (until C++23)
 
 
constexpr const_pointer operator->() const noexcept;
(1) (since C++26)
constexpr pointer operator->() noexcept;
(2) (since C++26)
constexpr const T& operator*() const& noexcept;
(3) (since C++26)
constexpr T& operator*() & noexcept;
(4) (since C++26)

Accesses the owned value.

1,2) Returns a pointer to the owned value.
3,4) Returns a reference to the owned value.

If *this is valueless, the behavior is undefined.

Return value

As described above.

Notes

This operator does not check whether *this is valueless, users can do so manually by using valueless_after_move().

Example


Web Proxy Viewer  |  New URL  |  Original Page