[ADT] use is_base_of inplace of is_same for random_access_iterator_tag checks
authorNathan James <n.james93@hotmail.co.uk>
Tue, 21 Jul 2020 08:55:14 +0000 (09:55 +0100)
committerNathan James <n.james93@hotmail.co.uk>
Tue, 21 Jul 2020 08:55:16 +0000 (09:55 +0100)
commit1890a65ca17504cab4032d3c8cc0c4c568d44717
tree784dcac10610e509ec6825e56438543fcdf882c6
parent62ccfb6ed0bed899f22abc00bec96a372420c5d0
[ADT] use is_base_of inplace of is_same for random_access_iterator_tag checks

Replace `std::is_same<X, std::random_access_iterator_tag>` with `std::is_base_of<std::random_access_iterator_tag, X>` in STLExtra algos.

This doesn't have too much impact on LLVM internally as no structs derive from it.
However external projects embedding LLVM may use `std::contiguous_iterator_tag` which should be considered by these algorithms.
As well as any other potential tags people want to define derived from `std::random_access_iterator_tag`

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D84141
llvm/include/llvm/ADT/STLExtras.h