Boost logo

Boost :

From: Stefan Roiser (stefan.roiser_at_[hidden])
Date: 2006-02-06 03:25:42


On 6 Feb 2006, at 00:36, Edward Diener wrote:

> Sebastian Redl wrote:
>> Edward Diener wrote:
>>
>>> Can you give an example of the compile-time use of reflection for
>>> templates and how this would be done ? Or have I completely
>>> misunderstood what you and Sebastian Redl are discussing ?
>>>
>>>
>> Although this came up in a different branch of discussion, the
>> topic of
>> David and my discussion was about the hardships of implementing a
>> solution that could, at run-time, instantiate a template and load the
>> newly generated code into the application.
>
> Clearly one can normally, from a template definition, instantiate a
> template at run-time in C++ now. How is this different from what
> you are
> suggesting above ?

We do have a user request to do exactly this with Reflex. I think it
should be possible along the ideas of this thread. What we want to do
is what you were discussing,

- generate the dictionary sources (with python/genreflex.py -
invoking gccxml)
- compile the so generated dictionary source into a module (shared lib)
- dynamically open the library and load the dictionary information

There is a project already at CERN which does exactly this, so it
should be feasible.

-- 
Stefan Roiser
CERN, PH Department
CH - 1211 Geneva 23
Mob:+41 76 487 5334
Tel:+41 22 767 4838
Fax:+41 22 767 9425

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