std::polymorphic<T, Allocator>::operator->, std::polymorphic<T, Allocator>::operator*
From cppreference.com
< cpp | memory | polymorphic
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Memory management library
(exposition only*)
(C++11)
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
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)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
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.
[edit] Return value
As described above.
[edit] Notes
This operator does not check whether *this is valueless, users can do so manually by using valueless_after_move()
.
[edit] Example
This section is incomplete
Reason: no example
Reason: no example