does cast make an lvalue appear to be an rvalue

Dicebot public at dicebot.lv
Wed Oct 16 10:58:39 PDT 2013


On Wednesday, 16 October 2013 at 17:50:48 UTC, Daniel Davidson 
wrote:
> On Wednesday, 16 October 2013 at 17:16:39 UTC, Dicebot wrote:
>>
>> It works as it should. Make a mutable copy of t2 and pass it. 
>> Or make foo() accept const. I can't imagine a single 
>> legitimate use case for destroying type system in a way you 
>> want.
>
> How do you propose to make a mutable copy *generically*?

Recursively going through the levels of indirection via static 
introspection and allocating memory for new mutable counter-parts 
as it goes. Maybe it should belong to Phobos, no idea right now, 
will know once I ever find the need for it.


More information about the Digitalmars-d-learn mailing list