mirror of
https://github.com/xfarrow/lasd.git
synced 2025-06-05 21:49:14 +02:00
Library 3
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user