Commit 8009807e authored by Kenton Varda's avatar Kenton Varda

Merge pull request #88 from partylemon/Iterator

Explicitly mark IndexingIterator as a RandomAccessIterator
parents e80de835 64462816
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include "layout.h" #include "layout.h"
#include "orphan.h" #include "orphan.h"
#include <initializer_list> #include <initializer_list>
#ifdef KJ_STD_COMPAT
#include <iterator>
#endif // KJ_STD_COMPAT
namespace capnp { namespace capnp {
namespace _ { // private namespace _ { // private
...@@ -506,4 +509,14 @@ private: ...@@ -506,4 +509,14 @@ private:
} // namespace capnp } // namespace capnp
#ifdef KJ_STD_COMPAT
namespace std {
template <typename Container, typename Element>
struct iterator_traits<capnp::_::IndexingIterator<Container, Element>>
: public std::iterator<std::random_access_iterator_tag, Element, int> {};
} // namespace std
#endif // KJ_STD_COMPAT
#endif // CAPNP_LIST_H_ #endif // CAPNP_LIST_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment