Boost logo

Boost Users :

From: james.jones_at_[hidden]
Date: 2006-10-13 08:47:28


From: "William Xue" <william.xue_at_[hidden]>
> Yes, it's a good explanation. Thanks a lot.
>
> For the reason I mentioned above, I perfer to do the job like this:
> ---8<--------------------------------------------->8---
> #ifdef cplusplus
> class ...
> {
> ...
> int foo(...) = 0;
> ...
> };
> #else
> class ...
> {
> ...
> int foo(...);
> ...
> };
> #endif
> ---8<--------------------------------------------->8---

The problem with doing it this way is that you're repeating yourself. What happens when you need to add a method? Did you remember to add it to both sections? When a signature changes, did you change it in both sections?

I don't think it is or should be a primary design goal of programming in any language to make things easy for beginners. There are all sorts of more important goals that come first.

-
James Jones Administrative Data Mgmt.
Webmaster 375 Raritan Center Pkwy, Suite A
Data Architect Edison, NJ 08837


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