yat  0.10.4pre
Public Member Functions
theplu::yat::utility::Dereferencer< Pointer > Struct Template Reference

Adaptor between pointer and pointee interface. More...

#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/utility/stl_utility.h>

List of all members.

Public Member Functions

 Dereferencer (void)
 constructor
std::iterator_traits< Pointer >
::reference 
operator() (Pointer ti) const

Detailed Description

template<typename Pointer>
struct theplu::yat::utility::Dereferencer< Pointer >

Adaptor between pointer and pointee interface.

Functor takes a pointer and returns a reference to the instance
pointer is pointing to. Return type is decided by <a
href=http://www.sgi.com/tech/stl/iterator_traits.html>
std::iterator_traits<Pointer>::reference </a>. Pointer must have
an \c operator*, i.e., \c Pointer can be a traditional pointer or
an <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>.

The class is designed to be used with boost::transform_iterator
std::vector<MyClass*> vec;
...
Dereferencer<MyClass*> dereferencer;
std::set<MyClass> s;
s.insert(boost::make_transform_iterator(vec.begin(), dereferencer),
boost::make_transform_iterator(vec.end(), dereferencer))

where elements in vec<MyClass*> are copied in to set<MyClass>.

Since:
New in yat 0.7

Member Function Documentation

template<typename Pointer >
std::iterator_traits<Pointer>::reference theplu::yat::utility::Dereferencer< Pointer >::operator() ( Pointer  ti) const
inline
Returns:
* ti

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

Generated on Mon Nov 11 2013 09:41:46 for yat by  doxygen 1.8.1