2017-04-06 08:28:43 -04:00
|
|
|
#ifndef OSRM_STATIC_ASSERT_HPP
|
|
|
|
#define OSRM_STATIC_ASSERT_HPP
|
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
|
2022-12-11 04:10:26 -05:00
|
|
|
namespace osrm::util
|
2017-04-06 08:28:43 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
template <typename It, typename Value> inline void static_assert_iter_value()
|
|
|
|
{
|
|
|
|
using IterValueType = typename std::iterator_traits<It>::value_type;
|
|
|
|
static_assert(std::is_same<IterValueType, Value>::value, "");
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename It, typename Category> inline void static_assert_iter_category()
|
|
|
|
{
|
|
|
|
using IterCategoryType = typename std::iterator_traits<It>::iterator_category;
|
|
|
|
static_assert(std::is_base_of<Category, IterCategoryType>::value, "");
|
|
|
|
}
|
|
|
|
|
2022-12-20 12:00:11 -05:00
|
|
|
} // namespace osrm::util
|
2017-04-06 08:28:43 -04:00
|
|
|
|
|
|
|
#endif // OSRM_STATIC_ASSERT_HPP
|