Calico
|
Lens
es are proxy objects that allow a value to be accessed and mutated via a pair of functions ("get" and "put").
More...
#include <type_traits>
#include <utility>
Classes | |
struct | cal::lens_base< Lens, T > |
CRTP base type for constructing Lens types. More... | |
struct | cal::lens_traits< Lens > |
Traits class for the Lens concept. More... | |
struct | cal::negating_lens< Lens, T > |
A lens that negates the value before storing or accessing it. More... | |
struct | cal::scaling_lens< Lens, Factor, T > |
A lens that scales the value by a factor before storing or accessing it. More... | |
Namespaces | |
cal | |
Primary namespace. | |
Functions | |
template<class T > | |
negating_lens< T > | cal::make_negating_lens (T &&x) |
Constructs a negating_lens from a given value. | |
template<class T , class U > | |
scaling_lens< T, U > | cal::make_scaling_lens (T &&lens, U &&factor) |
Constructs a scaling_lens from a given value. | |
Lens
es are proxy objects that allow a value to be accessed and mutated via a pair of functions ("get" and "put").
The concept is named after the Haskell lens package. Lens
es are not required to be Copyable
, only Movable
. They must allow the following operations: