thrust::system::cpp::pointer

Defined in thrust/system/cpp/pointer.h

template<typename T>
using thrust::system::cpp::pointer = thrust::pointer<T, thrust::system::cpp::tag, thrust::tagged_reference<T, thrust::system::cpp::tag>>

cpp::pointer stores a pointer to an object allocated in memory accessible by the cpp system. This type provides type safety when dispatching algorithms on ranges resident in cpp memory.

cpp::pointer has pointer semantics: it may be dereferenced and manipulated with pointer arithmetic.

cpp::pointer can be created with the function cpp::malloc, or by explicitly calling its constructor with a raw pointer.

The raw pointer encapsulated by a cpp::pointer may be obtained by eiter its get member function or the raw_pointer_cast function.

See also

cpp::malloc

See also

cpp::free

See also

raw_pointer_cast

Note

cpp::pointer is not a “smart” pointer; it is the programmer’s responsibility to deallocate memory pointed to by cpp::pointer.

Template Parameters

T – specifies the type of the pointee.