Boost logo

Boost Users :

From: james.jones_at_[hidden]
Date: 2006-05-05 09:15:40


From: Carlo Wood <carlo_at_[hidden]>
>Also, the above is slightly dangerous, as the 'public' would
>'leak' beyond the #ifdef when TESTING is defined. You'd have to make
>sure that the test block at the end of the class.

This is a very good point. A method defined as public in test might fail to compile as private in production.

>Personally, I like the #define private public best, because it doesn't
>polute the real code.

But this contradicts your prior good point. This is even more dangerous than the conditional public: which you objected to, because now *every* method is public! At least with the other method, you can do it safely if you're careful.

-
James Jones Administrative Data Mgmt.
(v)732-510-1806 375 Raritan Center Pkwy, Suite A
(f)732-510-1855 Edison, NJ 08837
Visit us on the web at http://www.firstinvestors.com/


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