Go to the source code of this file.
|
template<class T , class deleter_t = std::default_delete<T>> |
using | qx::unique_ref = details::smart_ptr_ref_adapter< std::unique_ptr, T, deleter_t > |
| A version of std::unique_ptr that cannot have an invalid value (nullptr) (compile time guaranteed). More...
|
|
|
template<class T , class... constructor_args_t> |
unique_ref< T > | qx::make_unique_ref (constructor_args_t &&... args) |
| Make a unique ref (same as std::make_unique but for qx::unique_ref) More...
|
|
template<class T , class deleter_t , class... constructor_args_t> |
unique_ref< T, deleter_t > | qx::make_unique_ref_with_deleter (deleter_t deleter, constructor_args_t &&... args) |
| Make a unique ref with a custom deleter. More...
|
|
- Author
- Khrapov
- Date
- 25.05.2025
- Copyright
- © Nick Khrapov, 2025. All right reserved.
Definition in file unique_ref.h.
◆ unique_ref
template<class T , class deleter_t = std::default_delete<T>>
using qx::unique_ref = typedef details::smart_ptr_ref_adapter<std::unique_ptr, T, deleter_t> |
A version of std::unique_ptr that cannot have an invalid value (nullptr) (compile time guaranteed).
Can only be constructed with make_unique_ref or make_unique_ref_with_deleter. Cannot be constructed from / assigned from / reset from a unique_ptr.
- Template Parameters
-
T | - type to store |
deleter_t | - optional custom deleter |
Definition at line 24 of file unique_ref.h.
◆ make_unique_ref()
template<class T , class... constructor_args_t>
unique_ref< T > qx::make_unique_ref |
( |
constructor_args_t &&... |
args | ) |
|
Make a unique ref (same as std::make_unique but for qx::unique_ref)
- Template Parameters
-
T | - type to store |
constructor_args_t | - T constructor types |
- Parameters
-
args | - T constructor values |
- Return values
-
Definition at line 14 of file unique_ref.inl.
◆ make_unique_ref_with_deleter()
template<class T , class deleter_t , class... constructor_args_t>
unique_ref< T, deleter_t > qx::make_unique_ref_with_deleter |
( |
deleter_t |
deleter, |
|
|
constructor_args_t &&... |
args |
|
) |
| |
Make a unique ref with a custom deleter.
- Template Parameters
-
T | - type to store |
deleter_t | - custom constructor type |
constructor_args_t | - T constructor types |
- Parameters
-
deleter | - custom constructor |
args | - T constructor values |
- Return values
-
Definition at line 22 of file unique_ref.inl.