Newsgroups: comp.lang.c++ Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Can we hide the private part of a class ? Message-ID: <1988Oct5.172203.8385@utzoo.uucp> Organization: U of Toronto Zoology References: <1358@stratus> <1988Sep29.044111.16104@utzoo.uucp> <4193@polya.Stanford.EDU> <1988Oct2.045604.17456@utzoo.uucp> <5922@june.cs.washington.edu> Date: Wed, 5 Oct 88 17:22:03 GMT In article <5922@june.cs.washington.edu> david@uw-june.UUCP (David Callahan) writes: >Changing the size or position of private elements changes only the >offsets of the public elements. These could be treated as external >variables and bound at link time rather than compile time. There might >small performance penalty... There will be a large performance penalty on many modern machines, unless the linker is smart enough to practically redo the code generation to compensate. Things like limited-range offset addressing modes, which are very common, really do require knowing the offset at code-generation time to avoid having to generate much slower worst-case code. >Inline functions are real compilation dependences and can not be hidden by late >binding, but the orginal poster's intent was to hide implementation details, >not avoid recompilation when public information changes, Inline functions are an optimization; their contents are no more "public information" than the types and sizes of private members. -- The meek can have the Earth; | Henry Spencer at U of Toronto Zoology the rest of us have other plans.|uunet!attcan!utzoo!henry henry@zoo.toronto.edu