Boost logo

Boost Users :

From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2006-10-12 23:40:49


On 10/12/06, William Xue <william.xue_at_[hidden]> wrote:
>
>
> It's just a example. Could you tell me why they use a macro to declare a
> abstract base class,
> instead of dircetly using '=0' ?
> I don't conceal what I have thought, they define the macro is only for
> design, overengineering,
> Just like "format" here.
>
> For, if I did not know this MACRO, it's hard to understand what's the
> meaning of 'int foo(...) PURE;',
> but it's very clear of 'int foo(...) = 0;', even if I am a beginner of
> C++, isn't it?
>
> PURE is only one of examples in codes of, as you said, polymorphic design.
> It's hard to understand,
> hard to study those technologies when there are a large number of these
> MACROs, essentially,
> they can be a little easier.
>
> Well, this is another topic.
>
>
IIR/UC, MS used PURE because the code actually compiled in both C and C++.
Under C++ it became '=0', but under C it was empty (I think). Basically,
you often saw this in interface definitions for COM objects, which, under C,
compiled into a struct of function pointers, and under C++ as a pure
interface class (and in memory, looked the same either way).

Tony



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