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
Currently, the node and slice types are specified as class templates (or more precisely, class template specializations), namely basic_json_node, basic_json_slice, and basic_const_json_slice.
It's unclear to me whether it's better to specify the shape of these type names. As per [namespace.std]/2, this will implicitly allow specializing these class templates if they get standardized. However, it's unlikely to meaningfully specialize them without specializing the associated basic_json.
If we make slice and node nested types with unspecified/exposition-only names, the slice types can be just implemented as nested class template template <bool IsConst> class slice_ {/* ... */};, which seems far less complicated than the current strategy.
This was intentional. Based on my thinking at the time, most interfaces always use json_slice instead of json, so having a separate name is a more direct way. There is similar reason for not using template parameters to distinguish whether it’s const, and intentional to let users differentiate between these two templates.
Currently, the node and slice types are specified as class templates (or more precisely, class template specializations), namely
basic_json_node
,basic_json_slice
, andbasic_const_json_slice
.It's unclear to me whether it's better to specify the shape of these type names. As per [namespace.std]/2, this will implicitly allow specializing these class templates if they get standardized. However, it's unlikely to meaningfully specialize them without specializing the associated
basic_json
.If we make slice and node nested types with unspecified/exposition-only names, the slice types can be just implemented as nested class template
template <bool IsConst> class slice_ {/* ... */};
, which seems far less complicated than the current strategy.CC @YexuanXiao.
The text was updated successfully, but these errors were encountered: