
Rene Rivera wrote:
Seems wrong; standard is that it's only in std:: if you're not including any of the <xxx.h> headers. You ought to look for it there by default and only pluck it from the global namespace on implementations that you know to be nonconforming in this regard. Same with size_t.
Perhaps the intent was to place the entire thing inside some namespace and hence the mbstate_t would not collide?
The story with program_options is simple. Initially it used std::mbstate_t and had namespace std { using ::mbstate_t; } for broken compilers. Later, Pavel reported that this does not work with his version of borland. For unknown reason, changing std::mbstate_t to just mbstate_t fixes those failures. That's why program_options now has mbstate_t in global scope. I know this is not the best thing to do, but my version of borland does not show that error, so I can't experiment with different workarounds. - Volodya