mathieu wrote:[color=blue]
> If you have nothing to do for memorial day here is the full source:
>
http://svn.sourceforge.net/viewcvs.c...?view=annotate
> Comments welcome.[/color]
That's funny... looking at that source, "comments welcome" is exactly
what I was thinking ;). Sorry, not enough time for guesswork -- though
if you'd care to point out the problematic section and explain what
you're trying to do in words, maybe you'll get the help you want.
[color=blue][color=green]
> > Whatever you're trying
> > to achieve, reinterpret_cast is not the way.[/color]
>
> I simply need to fill in my structure at run time.[/color]
You mean like a constructor does?
[color=blue]
> The only other way I
> can see is encapsulate all my templates (see link above) in one class
> that would have a giant switch depending on the templates argument.[/color]
That sounds like a pretty ugly way to solve... some problem. What's
the problem you're trying to solve? All you've said is "fill in my
structure at run time," which sounds like a description of what
constructors do. What is it that you're trying to accomplish that you
feel you can't do with a constructor?
[color=blue]
> It's always the same problem interfacing templated code with run time
> information.[/color]
There are definitely complexities involved. I'm confused, though,
because your question had nothing to do with templates.
[color=blue][color=green]
> > Could you explain what you mean by this? There's not really any logic
> > to speak of. Are you attempting to optimize for speed? Avoid code
> > duplication? I don't think either is happening here.[/color]
>
> I liked the fact the *compiler* was telling me something is wrong, such
> as array is too big/small, not the right type. The idea was that I
> could describe the whole DICOM standard, and then try to compile it, if
> it does not compile the standard has a problem :)[/color]
That sounds very interesting -- what does it have to do with my
question? All I asked is what you meant about how you "would like to
avoid duplicating the logic that take [sic] place when initializing
s1."
Luke