pgLab/core/std_utils.h
eelke 840af1e0a9 WIP: Added page showing list of functions.
Only list is shown, still working on details.
2018-11-25 09:06:01 +01:00

14 lines
264 B
C++

#ifndef STD_UTILS_H
#define STD_UTILS_H
#include <vector>
template <typename T>
const T& value_or(const std::vector<T> &vec, const size_t index, const T &def)
{
if (index < 0 || index >= vec.size())
return def;
return vec[index];
}
#endif // STD_UTILS_H