Possible @property compromise

Era Scarecrow rtcvb32 at yahoo.com
Thu Jan 31 16:07:15 PST 2013


On Thursday, 31 January 2013 at 23:57:59 UTC, Steven 
Schveighoffer wrote:
> On Thu, 31 Jan 2013 18:48:18 -0500, Era Scarecrow 
> <rtcvb32 at yahoo.com> wrote:
>> On Thursday, 31 January 2013 at 23:05:14 UTC, Steven 
>> Schveighoffer wrote:
>>>
>>>
>>> Also note that structs are not meant to have internal 
>>> pointers.  So a "property" struct with an internal pointer
>>>
>>> So a "property" struct with an internal pointer would have to 
>>> be modified when a copy of the struct is made.  But this is 
>>> bad, structs are supposed to be movable WITHOUT updating 
>>> anything.
>>
>>  Except when postblit is defined...? Or opAssign?
>
> I'm pretty sure structs are forbidden to have internal 
> pointers.  They must be able to be moved without any 
> post-processing.

  Hmmm... Well I threw out an idea about not returning inner 
structs (outside the controlling parent). If that were followed, 
the reference to the parent could silently be added to the 
function call rather than the struct itself; Then the data can be 
moved freely.



More information about the Digitalmars-d mailing list