This patch adds a convenience is_contained() function
which checks if an element exists in a container.
This patch was originally part of http://reviews.llvm.org/D12761.
Differential D16053
is_contained() convenience function Alexander_Droste on Jan 11 2016, 2:08 AM. Authored by
Details This patch adds a convenience is_contained() function This patch was originally part of http://reviews.llvm.org/D12761.
Diff Detail Event TimelineComment Actions
were the first author that appeared. Comment Actions Benjamin and I were just discussing a similar piece of code to this in a I think we were settling on something like "any_of(R, is_equal<>(E))" but Benjamin - any thoughts/preferences here? Comment Actions I think in the last review I/we were just suggesting to use any_of + In any case, std::equal_to is a C++14 feature, so we probably can't use it Comment Actions I personally dislike bind. I thought there was a a way to use std::equal_to without manually binding, but apparently there isn't, so adding is_contained is fine with me. Preferably with std::find as it avoids a confusing bind. Comment Actions
Comment Actions
bool is_contained(R && Range,.. Comment Actions Hi, as it seems, this patch has not been committed yet. |