Boost logo

Boost Users :

Subject: Re: [Boost-users] Help with (possibly MPL) pattern for a viewer that may contain a copy of statically allocated data
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2009-01-24 15:50:22


Steven Watanabe <watanabesj <at> gmail.com> writes:

>
> AMDG
>
> Jesse Perla wrote:
> > I am wondering what the best pattern/approach for a data structure
> > that may contain either a reference or a copy of some data used in a
> > constructor.[...]
>
> If you don't need to decide at runtime whether to store a copy or a
> reference, then you can avoid the reference when you have a copy
> using static polymorphism:
[beatiful solution snipped]

When the OP's post got to my mailbox, I rapidly put myself to
work in a solution with the hope that Steven was asleep or
somehow away from his computer, but he's done it again --beating
eveybody to providing an answer, and with style too!
It's not fair!

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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