Library 3

This commit is contained in:
Alessandro Ferro
2021-04-26 19:12:17 +02:00
parent 0d599672c4
commit c550ec0ef4
4 changed files with 301 additions and 117 deletions

View File

@ -1,10 +1,18 @@
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;
}
}