B
bonham28c
hi,
i m trying to make a custom bool class.
anything is the same as bool except when it is printing, i want it to
print + if true and - if false.
but it seems like i cant subclass bool like below:
class regions: public bool
{
public:
friend ostream& operator<<(ostream& ost, const bool& inRegions) {
return inRegions ? "+" : "-";
}
};
any suggestions?
thanks for any help!
i m trying to make a custom bool class.
anything is the same as bool except when it is printing, i want it to
print + if true and - if false.
but it seems like i cant subclass bool like below:
class regions: public bool
{
public:
friend ostream& operator<<(ostream& ost, const bool& inRegions) {
return inRegions ? "+" : "-";
}
};
any suggestions?
thanks for any help!