...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::svm_ptr
// In header: <boost/compute/memory/svm_ptr.hpp> template<typename T> class svm_ptr { public: // types typedef T value_type; typedef std::ptrdiff_t difference_type; typedef T * pointer; typedef T & reference; typedef std::random_access_iterator_tag iterator_category; // public member functions svm_ptr(); svm_ptr(void *, const context &); svm_ptr(const svm_ptr< T > &); svm_ptr< T > & operator=(const svm_ptr< T > &); ~svm_ptr(); void * get() const; svm_ptr< T > operator+(difference_type); difference_type operator-(svm_ptr< T >); const context & get_context() const; bool operator==(const svm_ptr< T > &) const; bool operator!=(const svm_ptr< T > &) const; };
svm_ptr
public member functionssvm_ptr();
svm_ptr(void * ptr, const context & context);
svm_ptr(const svm_ptr< T > & other);
svm_ptr< T > & operator=(const svm_ptr< T > & other);
~svm_ptr();
void * get() const;
svm_ptr< T > operator+(difference_type n);
difference_type operator-(svm_ptr< T > other);
const context & get_context() const;
bool operator==(const svm_ptr< T > & other) const;
bool operator!=(const svm_ptr< T > & other) const;