Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-05-13 09:43:04


On 05/12/2007 04:23 PM, remi.chateauneu_at_[hidden] wrote:
[snip]
> I do not know enough of this great library 'Fusion' to make a serious
> analysis, and BOOST_FUSION_ADAPT_STRUCT seems very close to what I did,

FWIW, I found the following two links useful for comparison:

   For crd, see lines 29-42 of:

http://crd.cvs.sourceforge.net/crd/crd/README?revision=1.4&view=markup

   For fusion, see lines 39-43 of:

http://boost.cvs.sourceforge.net/boost/boost/libs/fusion/test/sequence/adapt_struct.cpp?revision=1.2&view=markup&pathrev=HEAD

> although the whole library seems more oriented towards compile-time
> operations ?

Well, according to:

   the library is a "fusion" of compile time metaprogramming with runtime
   programming.

from the page:

   libs/fusion/doc/html/fusion/preface.html

it should do both. Of course I realize "seems more oriented towards
compile-time operations" is a "judgment call". However, it seems
that the "basic operations" in both crd and fusion is accessing
the I-th member in a tuple (or struct) and that the specific needs
you mention below can be implemented using either the fusion
"basic operations" or the crd "basic operations". If that's true
(i.e. the "basic operations" are the "basis of comparison") then
fusion is just as runtime oriented as crd.

> My specific needs are:
> - Iterations at run-time on class members, not only at compile-time,
> because some operations might be difficult to code (Trivial example: Add
> the latest ')' in a SQL query string). This implies, for example, that
> manipulation on a list of class members are done with plain STL algorithms.
> - The possibility to add dynamic attributes for class members, indexed
> for example by typeid (Column names in a SQL table, or specific format
> for displaying a given class member), which may change from one object
> to another of the same class.
> - The possibility to consider as a plain data member, any method
> (getter/setter ...) of a class, even if there is no underlying member,
> or if they are private, and also base classes.
>
[snip]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk