thrust

◆ get() [1/2]

template<int N, class HT , class TT >
__host__ __device__ access_traits< typename tuple_element<N, detail::cons<HT, TT> >::type >::non_const_type thrust::get ( detail::cons< HT, TT > &  t)
inline

The get function returns a reference to a tuple element of interest.

Parameters
tA reference to a tuple of interest.
Returns
A reference to t's Nth element.
Template Parameters
NThe index of the element of interest.

The following code snippet demonstrates how to use get to print the value of a tuple element.

#include <thrust/tuple.h>
#include <iostream>
...
thrust::tuple<int, const char *> t(13, "thrust");
std::cout << "The 1st value of t is " << thrust::get<0>(t) << std::endl;
See also
pair
tuple

Referenced by thrust::mr::unsynchronized_pool_resource< Upstream >::do_allocate(), thrust::mr::unsynchronized_pool_resource< Upstream >::do_deallocate(), thrust::mr::disjoint_unsynchronized_pool_resource< Upstream, Bookkeeper >::do_deallocate(), and thrust::mr::unsynchronized_pool_resource< Upstream >::release().