2021-04-24 16:58:05 +02:00
|
|
|
|
|
|
|
namespace lasd {
|
|
|
|
|
2021-04-26 19:12:17 +02:00
|
|
|
template <typename Data>
|
|
|
|
void AuxFoldExists(const Data& dat, const void* val, void* exists){
|
|
|
|
if(dat == *((Data*)val)){
|
|
|
|
*((bool*)exists) = true;
|
|
|
|
}
|
|
|
|
}
|
2021-04-24 16:58:05 +02:00
|
|
|
|
2021-04-26 19:12:17 +02:00
|
|
|
template <typename Data>
|
|
|
|
bool FoldableContainer<Data>::Exists(const Data& dat) const noexcept{
|
|
|
|
bool exists = false;
|
|
|
|
FoldPreOrder(&AuxFoldExists<Data>, &dat, &exists);
|
|
|
|
return exists;
|
|
|
|
}
|
2021-04-24 16:58:05 +02:00
|
|
|
|
|
|
|
}
|