|
Celeritas 0.7.0-dev.168+develop.6e17e5869
|
Type-safe non-owning pointer. More...
#include <ObserverPtr.hh>
Type aliases | |
| using | element_type = T |
| using | pointer = std::add_pointer_t< T > |
| using | reference = std::add_lvalue_reference_t< T > |
| constexpr | ObserverPtr () noexcept=default |
| CELER_CONSTEXPR_FUNCTION | ObserverPtr (std::nullptr_t) noexcept |
| CELER_CONSTEXPR_FUNCTION | ObserverPtr (pointer ptr) noexcept |
| template<class T2 > | |
| CELER_CONSTEXPR_FUNCTION | ObserverPtr (ObserverPtr< T2, M > other) noexcept |
Type-safe non-owning pointer.
This class is based on WG21 N4282, "A Proposal for the World’s Dumbest Smart Pointer, v4". It adds memspace safety similar to Thrust's host/device_ptr.
The dereferencing operators can only be used from the "native" memspace: i.e., host data can be accessed from a .cc file, and device data from a .cu file.
A manual pointer cast function can be used to access the pointer with no memspace checking.
| using celeritas::ObserverPtr< T, M >::element_type = T |
Construct a pointer
| using celeritas::ObserverPtr< T, M >::pointer = std::add_pointer_t<T> |
Construct a pointer
| using celeritas::ObserverPtr< T, M >::reference = std::add_lvalue_reference_t<T> |
Construct a pointer
|
constexprdefaultnoexcept |
Construct a pointer
|
inlinenoexcept |
Construct a pointer
|
inlineexplicitnoexcept |
Construct a pointer
|
inlinenoexcept |
Construct a pointer
|
inlinenoexcept |
Access the pointer
|
inlineexplicitnoexcept |
Access the pointer
|
inlineexplicitnoexcept |
Access the pointer
|
inlinenoexcept |
Access the pointer
|
inlinenoexcept |
Access the pointer
|
inlinenoexcept |
Modify the pointer
|
inlinenoexcept |
Modify the pointer
|
inlinenoexcept |
Modify the pointer