
On Sun, Nov 8, 2009 at 11:52 PM, Vladimir Prus
Yang Zhang wrote:
- value vs. wvalue
If your option type can be constructed from char* (either using custom validator, or operator>>), you can use value. If your option type can be constructed from wchar_t, you can use wvalue. If both, wvalue is a better since you won't loose data no matter what kind of parser is used.
Why would you ever lose data? UTF-8 and UTF-16 are both encodings of the same set of characters. Isn't that what codecvt converts between?
Given what wstring cannot be constructed from char*, you have to use wvalue for wstring.
You can't construct a vector<...> from a char* either, yet that's legal. See my confusion? :) This is why it's unclear to me what significance value vs. wvalue have - esp. since codecvt is doing conversions anyway. -- Yang Zhang http://www.mit.edu/~y_z/