Library 4

added previous libreries
This commit is contained in:
Alessandro Ferro
2021-05-11 06:52:44 +02:00
parent 25dadb7de6
commit 97407c2a31
23 changed files with 2366 additions and 962 deletions

16
librerie/exercise4/container/container.cpp Normal file → Executable file
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;
}
}