cuda::experimental::stf::with_location#

template<class T>
struct with_location#

Value (or reference) plus the call-site source_location of its construction.

Intended as a function parameter type: write with_location<widget> instead of widget so the callee can report file/line. Construction from an argument captures source_location::current() at that call site (overloaded operators cannot take defaulted source_location parameters themselves).

Move-only: may be constructed as a temporary and moved into a by-value parameter, but not copied. T may be a value, lvalue reference, or rvalue reference.

Public Functions

with_location(const with_location&) = delete#
with_location(with_location&&) = default#
template<typename U, ::cuda::std::enable_if_t<!::cuda::std::is_same_v<::cuda::std::decay_t<U>, with_location> && ::cuda::std::is_constructible_v<T, U&&>, int> = 0>
inline constexpr with_location(
U &&payload,
::cuda::std::source_location loc = ::cuda::std::source_location::current()
)#

Public Members

T payload#
const ::cuda::std::source_location loc#