Re: Regarding emplace, arrays, and helper functions

2013-08-30 Thread Ali Çehreli
On 08/30/2013 07:02 AM, Andrej Mitrovic wrote: > However will the compiler align all static arrays so their memory > begins at a proper offset? The compiler considers only the element type of the static array. > Maybe a more appropriate question is: Is all stack data guaranteed to > be properly

Re: Regarding emplace, arrays, and helper functions

2013-08-30 Thread Andrej Mitrovic
On 8/30/13, Namespace wrote: > I hate this "magic" library fix.. Why cannot we use 'scope' for > this? > I know currently it is an unsafe feature that was also proposed > for rejection, but it would look better, feel better, and the > compiler could take the dirty work for us. And maybe better > o

Re: Regarding emplace, arrays, and helper functions

2013-08-30 Thread Namespace
On Friday, 30 August 2013 at 14:45:40 UTC, Andrej Mitrovic wrote: On 8/30/13, Namespace wrote: I hate this "magic" library fix.. Why cannot we use 'scope' for this? I know currently it is an unsafe feature that was also proposed for rejection, but it would look better, feel better, and the comp

Re: Regarding emplace, arrays, and helper functions

2013-08-30 Thread Namespace
I hate this "magic" library fix.. Why cannot we use 'scope' for this? I know currently it is an unsafe feature that was also proposed for rejection, but it would look better, feel better, and the compiler could take the dirty work for us. And maybe better optimized.

Re: Regarding emplace, arrays, and helper functions

2013-08-30 Thread Andrej Mitrovic
On 8/30/13, Ali Çehreli wrote: > Now your program works with a single change: > > enum Size = paddedSize!C(); Excellent. However will the compiler align all static arrays so their memory begins at a proper offset? Maybe a more appropriate question is: Is all stack data guaranteed to be pro

Re: Regarding emplace, arrays, and helper functions

2013-08-29 Thread Ali Çehreli
On 08/29/2013 05:20 AM, Andrej Mitrovic wrote: > The emplace docs state that the chunk where to store the class object > instance needs to be aligned to the class type alignment. But it > doesn't say much on how to get this alignment from a class (we could > add a note about using the classInstan

Re: Regarding emplace, arrays, and helper functions

2013-08-29 Thread bearophile
A little related: http://d.puremagic.com/issues/show_bug.cgi?id=8873 Bye, bearophile

Regarding emplace, arrays, and helper functions

2013-08-29 Thread Andrej Mitrovic
The emplace docs state that the chunk where to store the class object instance needs to be aligned to the class type alignment. But it doesn't say much on how to get this alignment from a class (we could add a note about using the classInstanceAlignment template), or even how to use it to create e.