Example #1
0
    static void extract(const jsonpack::value &v, char* json_ptr, Seq &value)
    {
        array_t arr = *v._arr;
        value.clear();

        for(const auto &it : arr)
        {
#ifndef _MSC_VER
            // Initialize before use
            type_t val = {};
#else
            type_t val;
#endif  
            if( json_traits<type_t&>::match_token_type(it) )
            {
                json_traits<type_t&>::extract(it, json_ptr, val);
                value.insert(value.end(), val); //faster way in each container
            }
            else
            {
                throw type_error( "Array item type mismatch" );
            }
        }

    }