Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost preprocessor question
From: Michiel Helvensteijn (m.helvensteijn_at_[hidden])
Date: 2009-01-05 14:57:26


Tim Day wrote:

> Have you considered how boost::tuple might help ?
> A boost::tuple<int,bool> would seem to provide most of the above.
> A simple template could provide a tuple-wrapping class restricting
> allocation to the shared_ptr--returning construct method. OK so you
> wouldn't get to name the members, and the construct method itself would
> presumably need to take a tuple (unless you provide sufficient templated
> member functions to handle as many arguments as necessary). I don't
> know how important those aspects are to you though.

Quite important, actually. I suspect using boost tuples in a wrapper would
result in the same amount of code as unboosted code, if not more.

> In my experience, trying to be too clever with the preprocessor results
> in a nastier mess than the problem you were originally trying to solve.

Hm. Not really. I've already done some things with the preprocessor that
significantly shortened and clarified my code. The only downside for me
seems to be that syntax highlighting will not work.

-- 
Michiel Helvensteijn

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