Bool CArchive
-
Hi guys, In VS 6 C++ there was no Bool CArchive Operator so we made one of our own where it used an int for true = 1 false = 0, naturally. Now I see .NET C++ they have been clever and added one of their own, how can I disable that and use my own without having to derive a class from CArchive and overloading it?? I would be interested to hear if anyone else has this problem The Wudan Master
-
Hi guys, In VS 6 C++ there was no Bool CArchive Operator so we made one of our own where it used an int for true = 1 false = 0, naturally. Now I see .NET C++ they have been clever and added one of their own, how can I disable that and use my own without having to derive a class from CArchive and overloading it?? I would be interested to hear if anyone else has this problem The Wudan Master
I guess you defined your homemade operator as a global
CArchive& operator<<(CArchive& ar,bool b)
, right? If so, and if you can afford some syntax ugliness, you can force selection of this operator instead of the built-in one by calling it explicitly like this:CArchive ar;
...
operator<<(ar,true); //in isolated form
operator<<(ar<<1<<2,false)<<3<<4; //inside a chain, outputs 12034Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
I guess you defined your homemade operator as a global
CArchive& operator<<(CArchive& ar,bool b)
, right? If so, and if you can afford some syntax ugliness, you can force selection of this operator instead of the built-in one by calling it explicitly like this:CArchive ar;
...
operator<<(ar,true); //in isolated form
operator<<(ar<<1<<2,false)<<3<<4; //inside a chain, outputs 12034Joaquín M López Muñoz Telefónica, Investigación y Desarrollo