Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-05-10 09:33:42

"Jonathan Turkanis" <technews_at_[hidden]> wrote

> I would like to propose the proposed Boost Interfaces library, which I
> introduced several months ago, for formal review. (Or maybe I should say:
> like to nominate the candidate Boost Interfaces library.)
> See for download and

Hi Jonathan,

I took a look at the documentation, and I think, the library could be very
useful. If I understand correctly, one of applications would be to apply
dynamically polymorphic proxies to statically polymotphic objects, in order,
to, for example, put them into a container. I had similar problem in the
past, and solved it by hand.

I have one quetion/suggestion:

Do you think your macro interface is flexible enough to incorporate all your
future enhancements? I mean, if you have something like:

    BOOST_IDL_CONST_FN0(x, long)
    BOOST_IDL_CONST_FN0(y, long)
    BOOST_IDL_FN1(x, void, long)
    BOOST_IDL_FN1(y, void, long)

you can only expand it to something that have the fixed structure: start
block, one block per every function, and then closing block. You cannot,
for example generate more than one class. I don't know if this restriction
is too strong, though. It depends on what you want to do next.

The other (minor) problem is that your user has to repeat the interface name

So, what I am leading to, is, that,using the technique described in, you could remove the
above restrictions, and achieve something like following:

    BOOST_IDL_CONST_FN0(x, long)
    BOOST_IDL_CONST_FN0(y, long)
    BOOST_IDL_FN1(x, void, long)
    BOOST_IDL_FN1(y, void, long)

or, if you are willing to treat macro prefixes for a couple of extra

    (CONST_FN0(long, x))
    (CONST_FN0(long, y))
    (FN1(void, x, long))
    (FN1(void, y, long))

The drawback would be that this would imply a little more involved
preprocessor programming. I don't know how you feel about it. In any case,
using the above mentioned technique, you can keep it well structured and
easily extendable.

If you are interested, I can give you more details.


Boost list run by bdawes at, gregod at, cpdaniel at, john at