lasd/librerie/exercise1/container/container.cpp

19 lines
369 B
C++
Raw Normal View History

namespace lasd {
template <typename Data>
void AuxFoldExists(const Data& dat, const void* val, void* exists){
if(dat == *((Data*)val)){
*((bool*)exists) = true;
}
}
template <typename Data>
bool FoldableContainer<Data>::Exists(const Data& dat) const noexcept{
bool exists = false;
FoldPreOrder(&AuxFoldExists<Data>, &dat, &exists);
return exists;
}
2021-04-09 10:31:22 +02:00
}