#pragma once #include #include namespace storm { namespace adapters { template struct Dereferencer { decltype((*std::declval())) operator()(T const& t) const { return *t; } }; template class DereferenceIteratorAdapter { public: typedef typename ContainerType::value_type value_type; typedef typename std::conditional::value, typename ContainerType::const_iterator, typename ContainerType::iterator>::type input_iterator; typedef typename boost::transform_iterator, input_iterator> iterator; DereferenceIteratorAdapter(input_iterator it, input_iterator ite) : it(it), ite(ite) { // Intentionally left empty. } iterator begin() const { return boost::make_transform_iterator(it, Dereferencer()); } iterator end() const { return boost::make_transform_iterator(ite, Dereferencer()); } static iterator make_iterator(input_iterator it) { return boost::make_transform_iterator(it, Dereferencer()); } private: input_iterator it; input_iterator ite; }; } }