These are chat archives for boostorg/hana

28th
Sep 2016
mopleen
@mopleen
Sep 28 2016 06:40
Unfortunately, != operator is not mentioned in neither hana documentation nor cppreference: http://en.cppreference.com/w/cpp/concept/EqualityComparable http://www.boost.org/doc/libs/1_61_0/libs/hana/doc/html/group__group-Comparable.html . Thanks for quick response!
Louis Dionne
@ldionne
Sep 28 2016 15:06

Hana mentions this:

Free model for EqualityComparable data types

Two data types T and U that model the cross-type EqualityComparable concept presented in N3351 automatically model the Comparable concept [...]

Jason Rice
@ricejasonf
Sep 28 2016 22:37
@ldionne How are views used? I was looking at view_storage and noticed it stores a reference. Does that mean that a const& won't work?
Louis Dionne
@ldionne
Sep 28 2016 22:51
auto tuple = hana::make_tuple(1, 2, 3);
auto view = hana::make_view(tuple); // mutable view

auto const ctuple = hana::make_tuple(1, 2, 3);
auto cview = hana::make_view(ctuple); // view-over-const, not mutable
That's the spirit, I need to test more.
And it should be possible to have stuff like views over optionals, etc.
Jason Rice
@ricejasonf
Sep 28 2016 23:36
Why don't views have their own tags? Is there not a penalty for all of the overloading in each function impl?
Louis Dionne
@ldionne
Sep 28 2016 23:37
The idea is that view should be a data type of its own, and you never actually create a view with something like sliced, etc..
You only create a view withmake_view, and then pretend it’s a normal container and use normal algorithms on it.