gratuitous new features in 2.0
Brett g Porter
BgPorter at NOartlogicSPAM.com
Fri Aug 25 09:47:29 EDT 2000
"Roy Katz" <katz at Glue.umd.edu> wrote in message
news:Pine.GSO.4.21.0008250847320.4353-100000 at z.glue.umd.edu...
> Absolutely agreed!
>
> That last point is what especially concerns me. C++ is full of these
> one-context throw-away grammatical oddities such as 'unsigned short
> BIT_FIELD_NAME: N' (the colon) and 'using namespace ...' (could you
> *ever* put anything other than 'namespace' in the 'using'
> declaration??)
>
Yes, of course.
2 examples adapted from Stroustrup (p. 407, 3rd ed):
class B{
protected:
int b;
};
class D : public B {
public:
using B::b; // makes the protected member publically visible from D
};
/// and ...
class BB : private B {
using B::b; // BB can't be used as a B, but still provides access
to the 'b' member.
};
oh, and the bitfield syntax comes straight from C.
FWIW, I agree with the prevailing sentiment here that overloading '>>' is a
bad thing.
--
// Brett g Porter * Senior Engineer, Application Development
// BgPorter @ artlogic . com * http://www.artlogic.com
// Art & Logic * Custom software solutions for hardware products
// Windows * MacOS * Embedded Systems
More information about the Python-list
mailing list