Creating a New View

Note

TODO: an actual tutorial, for now the main points are listed.

  • Template on the aliased type. For type T expect T and const T

  • Use traits to work out the correct const-ness of member types

  • For template parameter T, View<T> should support implicit conversions from:

    • References to T objects

    • For T == const U, View<U> objects

  • Comparisons should work between objects of type View<T> and all objects for which implicit conversions are allowed.

  • Comparison operations need to be defined symmetrically, i.e., make sure the view can be on the left and the right side of the operator.