20 #ifndef jsonserial_forward_list_hpp
21 #define jsonserial_forward_list_hpp
22 #include <forward_list>
23 namespace jsonserial {
25 template <
class T,
class Alloc>
26 struct is_std_forward_list<std::forward_list<T,Alloc>>: std::true_type {};
29 struct JSonArrayImpl<T, typename std::enable_if<is_std_forward_list<T>::value>::type> :
public JSonArray {
31 typename T::iterator pos_;
33 JSonArrayImpl(T& cont) : cont_(cont) {cont_.clear(); pos_ = cont_.before_begin();}
35 void add(JSonSerial& js, JSonClass::Creator* cr, JKString& s)
override {
36 typename T::value_type val;
38 readArrayValue(js, val, objptr, cr, s);
39 pos_= cont_.insert_after(pos_, val);