Joel de Guzman
On 6/12/15 3:39 AM, Louis Dionne wrote:
Instead, in a heterogeneous setting, you probably want it to return false_. With Fusion/MPL, this is not a problem because they use `std::is_same` to perform comparisons. However, `std::is_same` performs a very shallow comparison and only allows comparing types. Instead, Hana uses a more general system which also allows comparing values, but we have to return false_ for unrelated objects, a bit like `std::is_same` returns `std::false_type` on unrelated types.
I might not be understanding this correctly, but Fusion == does not use std::is_same. It does value comparison much like tuples.
Joel, Indeed, my answer was not very clear. What I meant is that Fusion uses std::is_same for the fusion::{find, filter, remove, erase_key, ...} algorithms. In addition, Fusion defines the usual comparison operators for sequences (==, !=, ...), like you correctly pointed out. Instead, Hana uses the same comparison function (`equal`) for all these operations. However, for some algorithms, the comparison operator must return an IntegralConstant. Regards, Louis