Boost logo

Boost :

Subject: Re: [boost] [OT][RFC] standardized compile-time reflection
From: Hite, Christopher (Christopher.Hite_at_[hidden])
Date: 2012-04-25 06:15:47


I'm going to put in my own 2 cents. Right now I'm using metaprogramming to generate fusion::maps as structures. Perhaps one day it'd be better to use something like mirror to go the other way or combine a meta-programatic protocol description with a user defined structure with a subset of the fields he wants. It'd be way easier for a user to deal with a regular structure than a generated fusion::map.

1) Someone mentioned it being problematic to iterate of members of a namespace. I think it souldn't be done since additional compliation scopes can add more to a namespace. Namespaces are open ended. A complete structure should be no problem though.

2) AFAICT mirror doesn't work for templates types or template members.

3) I'm more for a meta-function syntax than an operator. To me mirror<T> seems like a natural extension of type traits.

4) Should mirror< mirror< T > > work?

5) Should conversion ever work the opposite way? Should I be able to meta-programatically generate types from your representation:
typedef unmirror< addField< mirror<T>, "member", int> > NewT;

Obviously that would require a ton of compiler magic, but might be something to think about. Is your representation easy to manipulate/generate? How cubersome would addField<> be?

Chris


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