[xsd-users] Mapping for string-based enumerations: string constructors?

Boris Kolpackov boris at codesynthesis.com
Thu Mar 12 09:58:49 EDT 2015


Hi Yury,

Yury Zaytsev <yury.zaytsev at traveltainment.de> writes:

> However, at the same time it would be useful to have a public conversion 
> function (string -> value) in conjunction with the option to disable 
> string constructors.

Here we go... As I said, the only "fix" that I am willing to entertain
is to disable the string-based ctors. Nothing extra.


> For instance, I currently have dynamic translation tables stored as 
> strings in the input files. I could then explicitly call
> 
>      EnumType::value v = EnumType::convert("key");
>      const auto e = EnumType{v};

You know you can use type customization with a template to wrap all
your generated enums and provide exactly the interface that you need?


Boris



More information about the xsd-users mailing list