Implements Alternatives for MLD
This commit is contained in:
committed by
Patrick Niklaus
parent
fef0344be0
commit
54ceb05420
@@ -0,0 +1,26 @@
|
||||
#ifndef OSRM_STATIC_ASSERT_HPP
|
||||
#define OSRM_STATIC_ASSERT_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
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, "");
|
||||
}
|
||||
|
||||
} // ns util
|
||||
} // ns osrm
|
||||
|
||||
#endif // OSRM_STATIC_ASSERT_HPP
|
||||
Reference in New Issue
Block a user