Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
host_ptr.hpp File Reference

A std::shared_ptr-equivalent whose handle is trivially copyable onto a device (host-resident value).

Classes

class  mundy::host_ptr< T >
 A reference-counted shared handle to a host-resident T whose handle is trivially copyable onto a device. More...
struct  std::hash< mundy::host_ptr< T > >
 Hash a host_ptr by its pointed-to address, like std::hash<std::shared_ptr<T>>. More...

Namespaces

namespace  mundy

Functions

template<typename T, typename... Args>
host_ptr< T > mundy::make_host_ptr (Args &&... args)
 Construct a host_ptr<T> owning a fresh T, forwarding args to its constructor. Mirrors make_shared.
template<typename T>
void mundy::swap (host_ptr< T > &lhs, host_ptr< T > &rhs) noexcept
 Non-member swap.
Pointer casts (share ownership, retype the pointer — mirror std::shared_ptr's casts)
template<typename U, typename T>
host_ptr< U > mundy::static_pointer_cast (const host_ptr< T > &ptr) noexcept
template<typename U, typename T>
host_ptr< U > mundy::dynamic_pointer_cast (const host_ptr< T > &ptr) noexcept
template<typename U, typename T>
host_ptr< U > mundy::const_pointer_cast (const host_ptr< T > &ptr) noexcept
template<typename U, typename T>
host_ptr< U > mundy::reinterpret_pointer_cast (const host_ptr< T > &ptr) noexcept
Comparisons (by the pointed-to address, like std::shared_ptr)
template<typename T>
bool mundy::operator== (const host_ptr< T > &lhs, const host_ptr< T > &rhs) noexcept
template<typename T>
std::strong_ordering mundy::operator<=> (const host_ptr< T > &lhs, const host_ptr< T > &rhs) noexcept
template<typename T>
bool mundy::operator== (const host_ptr< T > &ptr, std::nullptr_t) noexcept
template<typename T>
std::strong_ordering mundy::operator<=> (const host_ptr< T > &ptr, std::nullptr_t) noexcept