MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / iterator_input_adapter

Class iterator_input_adapter

Source/external/json.hpp:6208–6240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6206// theoretically possible for some containers, but it is extremely versatile.
6207template<typename IteratorType>
6208class iterator_input_adapter
6209{
6210 public:
6211 using char_type = typename std::iterator_traits<IteratorType>::value_type;
6212
6213 iterator_input_adapter(IteratorType first, IteratorType last)
6214 : current(std::move(first)), end(std::move(last))
6215 {}
6216
6217 typename std::char_traits<char_type>::int_type get_character()
6218 {
6219 if (JSON_HEDLEY_LIKELY(current != end))
6220 {
6221 auto result = std::char_traits<char_type>::to_int_type(*current);
6222 std::advance(current, 1);
6223 return result;
6224 }
6225
6226 return std::char_traits<char_type>::eof();
6227 }
6228
6229 private:
6230 IteratorType current;
6231 IteratorType end;
6232
6233 template<typename BaseInputAdapter, size_t T>
6234 friend struct wide_string_input_helper;
6235
6236 bool empty() const
6237 {
6238 return current == end;
6239 }
6240};
6241
6242
6243template<typename BaseInputAdapter, size_t T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected