Skip to content

Commit 805bd09

Browse files
committed
Remove iterator validation
Validation breaks MSVC debug builds and should be delegated to the base C++ iterator validation when the appropriate debugging for this is activated (as in e.g. MSVC debug mode builds).
1 parent ef470ed commit 805bd09

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

include/jlcxx/stl.hpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@ struct IteratorWrapper
128128
iterator_type value;
129129
};
130130

131-
template <typename T>
132-
void validate_iterator(T it)
133-
{
134-
using IteratorT = typename T::iterator_type;
135-
if (it.value == IteratorT())
136-
{
137-
throw std::runtime_error("Invalid iterator");
138-
}
139-
}
140-
141131
struct WrapIterator
142132
{
143133
template <typename TypeWrapperT>
@@ -147,7 +137,7 @@ struct WrapIterator
147137
using ValueT = typename WrappedT::value_type;
148138

149139
wrapped.method("iterator_next", [](WrappedT it) { ++(it.value); return it; });
150-
wrapped.method("iterator_value", [](WrappedT it) { validate_iterator(it); return *it.value; });
140+
wrapped.method("iterator_value", [](WrappedT it) { return *it.value; });
151141
wrapped.method("iterator_is_equal", [](WrappedT it1, WrappedT it2) {return it1.value == it2.value; });
152142
};
153143
};

0 commit comments

Comments
 (0)