##// END OF EJS Templates
[Catalogues] Switch to new catalogues lib in progress, load/saves/query methods implemented for new...
[Catalogues] Switch to new catalogues lib in progress, load/saves/query methods implemented for new Catalogue controller Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r53:cd10c3acad49
r53:cd10c3acad49
Show More
containers.h
28 lines | 701 B | text/x-c | CLexer
#ifndef CONTAINERS_H
#define CONTAINERS_H
#include "cpp_utils.h"
#include <algorithm>
#include <map>
#include <vector>
namespace SciQLop::containers
{
template<class T1, class T2>
auto contains(const T1& container, const T2& value)
-> decltype(container.front(), std::end(container), true)
{
return std::find(std::cbegin(container), std::cend(container), value) !=
std::cend(container);
}
template<class T1, class T2>
auto contains(const T1& container, const T2& value)
-> decltype(container.find(value), std::cend(container), true)
{
return container.find(value) != std::cend(container);
}
} // namespace SciQLop::containers
#endif // CONTAINERS_H