TermOx
Public Types | Public Member Functions | List of all members
ox::Transform_view< Container, Map_fn > Class Template Reference

Read only Container view that applies transformation to elements at access. More...

#include <transform_view.hpp>

Public Types

using Reference = std::invoke_result_t< Map_fn, typename Container::reference >
 
using Reference_const = std::invoke_result_t< Map_fn, typename Container::const_reference >
 

Public Member Functions

 Transform_view (Container &c, Map_fn map_fn)
 
auto size () const -> std::size_t
 
auto is_empty () const -> bool
 
auto operator[] (std::size_t i) const -> Reference_const
 
auto operator[] (std::size_t i) -> Reference
 
auto front () const -> Reference_const
 
auto front () -> Reference
 
auto back () const -> Reference_const
 
auto back () -> Reference
 
auto begin () const
 
auto begin ()
 
auto end () const
 
auto end ()
 

Detailed Description

template<typename Container, typename Map_fn>
class ox::Transform_view< Container, Map_fn >

Read only Container view that applies transformation to elements at access.

Container is assumed to have a vector like interface. Transformation is applied at iterator dereference and operator[]. This is a non-owning view, relies on passed in container being alive as long as this view is.\


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