How do you deal with scoped allocations?

David Nadlinger code at klickverbot.at
Sat Dec 7 16:05:40 PST 2013


On Saturday, 7 December 2013 at 23:26:05 UTC, Namespace wrote:
> struct Helper(T, uint StackSize = 128) {
> 	static T[StackSize] buffer = void;

Using a static variable here means that there is only one such 
buffer per thread (and e.g. it wouldn't be possible to use the 
helper twice in the same call stack) - is this really what you 
want?

David


More information about the Digitalmars-d mailing list