u5e
UnicodeTextC++Library
iterator_assertion.hpp
1 #ifndef INCLUDED_U5E_ITERATOR_ASSERTION
2 #define INCLUDED_U5E_ITERATOR_ASSERTION
3 
4 #include <iterator>
5 
6 namespace u5e {
7  /**
8  * \brief Asserts the iterator is consistently defined
9  */
10  template <typename WRAPPED, typename T>
12  typedef typename std::iterator_traits<WRAPPED>::value_type VT;
13  static_assert(sizeof(VT)==sizeof(T),
14  "sizeof value_type incompatible with encoding");
15  static_assert(alignof(VT)==alignof(T),
16  "alignof value_type incompatible with encoding");
17  static_assert(std::is_integral<VT>::value,
18  "value_type is not an integral type");
19  };
20 };
21 
22 #endif
main u5e namespace
Asserts the iterator is consistently defined.