read does not work with basic_ifstream< unsigned char >

John Love-Jensen eljay@adobe.com
Fri Oct 6 11:38:00 GMT 2006


Hi Luciano,

You haven't plumbed up the facet, the locale, and/or the codecvt facilities
for your new stream's base type.

Some C++ compilers give you those things for char, and plumb char up to
locale facilities provided by the OS (e.g., the LC_ALL environment
variable).

Most C++ compilers give you those things for char and wchar_t, and, again,
plumb char and wchar_t up to locale facilities provided by the OS.

I don't know of any C++ compilers that provide you those things for unsigned
char, nor do I know of any OS that provides those facilities for unsigned
char.

Take a look at "Standard C++ IOStreams and Locales" by Angelika Langer and
Klaus Kreft, for all the gory details.

You'll be whipping up your own custom std::basic_ifstream<float> and
std::basic_ifstream<MyBigStruct> in no time.

HTH,
--Eljay



More information about the Gcc-help mailing list