breese / trial.protocol

Network wire protocols
11 stars 4 forks source link

Wide strings #15

Closed breese closed 7 years ago

breese commented 7 years ago

dynamic::variable is currently defined as an alias for dynamic::basic_variable<char>. This CharT template parameter is then used to select the internal string type. So you need to define a new alias for dynamic::basic_variable<wchar_t> to handle wide-character strings.

After some thinking, I believe that it would be better to remove the template parameter completely, and instead add all four standard string types as union members of dynamic::variable (which then becomes a class instead of an alias.)

This means that a dynamic::variable can store any fundamental type (where void/nullptr are replaced by a null type) and any standard string, as well as an array or map of other dynamic::variable.

Comments?

breese commented 7 years ago

Committed to develop.