mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 04:25:29 -04:00
18 lines
358 B
C
18 lines
358 B
C
|
|
#ifndef OPENMC_CONTAINER_UTIL_H
|
||
|
|
#define OPENMC_CONTAINER_UTIL_H
|
||
|
|
|
||
|
|
#include <algorithm> // for find
|
||
|
|
#include <iterator> // for begin, end
|
||
|
|
|
||
|
|
namespace openmc {
|
||
|
|
|
||
|
|
template<class C, class T>
|
||
|
|
inline bool contains(const C& v, const T& x)
|
||
|
|
{
|
||
|
|
return std::end(v) != std::find(std::begin(v), std::end(v), x);
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace openmc
|
||
|
|
|
||
|
|
#endif // OPENMC_CONTAINER_UTIL_H
|