How to specialize templates for l-value and non-l-value arguments?
Roman D. Boiko
rb at d-coding.com
Thu Jun 14 08:49:46 PDT 2012
On Thursday, 14 June 2012 at 15:27:24 UTC, Roman D. Boiko wrote:
> I have a struct that holds an immutable pointer to some data. I
> would like to initialize it with a pointer to anything that is
> passed inside, so if it is a not an l-value, I would need to
> copy it to the heap first. How can I determine if it is an
> l-value? How to implement copying correctly?
Comments like "this is bullshit, you don't want to do that" are
welcome :) I'm not sure what would be the correct thing to do in
this case.
More information about the Digitalmars-d-learn
mailing list