Extended CUDA Library (ecuda)  2.0
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Types | Public Member Functions | List of all members
ecuda::owner_less< shared_ptr< T > > Struct Template Reference

#include <memory.hpp>

Public Types

typedef bool result_type
 
typedef shared_ptr< T > first_argument_type
 
typedef shared_ptr< T > second_argument_type
 

Public Member Functions

__HOST__ __DEVICE__ bool operator() (const shared_ptr< T > &lhs, const shared_ptr< T > &rhs) const
 Compares lhs and rhs using owner-based semantics. More...
 

Detailed Description

template<typename T>
struct ecuda::owner_less< shared_ptr< T > >

This function object provides owner-based (as opposed to value-based) mixed-type ordering of ecuda::shared_ptr. The order is such that two smart pointers compare equivalent only if they are both empty or if they both manage the same object, even if the values of the raw pointers obtained by get() are different (e.g. because they point at different subobjects within the same object).

This class template is the preferred comparison predicate when building associative containers with ecuda::shared_ptr as keys, that is: std::map< ecuda::shared_ptr<T>, U, ecuda::owner_less<ecuda::shared_ptr<T> > >.

Definition at line 115 of file memory.hpp.

Member Typedef Documentation

template<typename T >
typedef shared_ptr<T> ecuda::owner_less< shared_ptr< T > >::first_argument_type

Definition at line 118 of file memory.hpp.

template<typename T >
typedef bool ecuda::owner_less< shared_ptr< T > >::result_type

Definition at line 117 of file memory.hpp.

template<typename T >
typedef shared_ptr<T> ecuda::owner_less< shared_ptr< T > >::second_argument_type

Definition at line 119 of file memory.hpp.

Member Function Documentation

template<typename T >
__HOST__ __DEVICE__ bool ecuda::owner_less< shared_ptr< T > >::operator() ( const shared_ptr< T > &  lhs,
const shared_ptr< T > &  rhs 
) const
inline

Compares lhs and rhs using owner-based semantics.

Parameters
lhs,rhsshared-ownership pointers to compare
Returns
true if lhs is less than rhs as determined by the owner-based ordering

Definition at line 126 of file memory.hpp.


The documentation for this struct was generated from the following file: