You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems as if is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value holds true in the inheritance case when j["o"] = j1 is called: j1 is treated as if it was an array, so static void construct(BasicJsonType& j, const CompatibleArrayType& arr) is called on the range j1.begin()/j1.end(). As j1 is a string, this range returns exactly 1 item. For this reason, the result is ["v"].
I am not sure how to fix this right now. Maybe @theodelrieu has an idea. I guess we all just forgot about the case of inheriting from basic_json.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
nlohmann commentedon Jun 6, 2017
It seems as if
is_compatible_array_type<BasicJsonType, CompatibleArrayType>::valueholds true in the inheritance case whenj["o"] = j1is called:j1is treated as if it was an array, sostatic void construct(BasicJsonType& j, const CompatibleArrayType& arr)is called on the rangej1.begin()/j1.end(). Asj1is a string, this range returns exactly 1 item. For this reason, the result is["v"].I am not sure how to fix this right now. Maybe @theodelrieu has an idea. I guess we all just forgot about the case of inheriting from
basic_json.theodelrieu commentedon Aug 14, 2017
Sorry for the veeery late reply, just found about this issue.
I will look into it!
stale commentedon Oct 25, 2017
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.