|
Boost Users : |
Subject: Re: [Boost-users] [test] testing protected/private methods out of test suits
From: Daniel Krügler (dsp_at_[hidden])
Date: 2008-09-23 01:41:54
Zeljko Vrba wrote:
> On Mon, Sep 22, 2008 at 12:44:01PM -0600, Robert Mecklenburg wrote:
>> I would swear that the standard indicated that public/private had no
>> effect on visibility, just accessibility. That is, changing a
>> symbol's access from private to public did not change the meaning of a
>> program. Stroustrup uses such language in the D&E of C++.
>>
> I recall somewhat vaguely a similar discussion on comp.lang.c++.moderated
> where the conclusion was that redefining keywords such as public/private
> via preprocessor macros leads to undefined behavior. I don't think that
> MS violates the standard with this particular behavior.
Correct. This is worded in C++03, [lib.macro.names]/2:
"[..] Nor shall such a translation unit define macros for names
lexically identical to keywords."
The current working paper has refined this in [macro.names]/2:
"A translation unit shall not #define or #undef names lexically
identical to keywords."
Greetings from Bremen,
Daniel
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net