On Tuesday, 15 January 2013 at 11:19:50 UTC, mist wrote:
I thought template itself should compile but its statement-like
instantiation should not.
The template shouldn't compile: the D grammar says that mixin
templates inject declarations only. Hence the text of the error.
By the way, if all
I thought template itself should compile but its statement-like
instantiation should not.
By the way, if all you want is to split out some generic
statement block without using dirty string mixins, template
functions with alias parameters may do.
I.e. http://dpaste.1azy.net/68ad8133
Don't kn
On Monday, 14 January 2013 at 06:26:33 UTC, 1100110 wrote:
On 01/13/2013 11:35 PM, 1100110 wrote:
Ok, I wish to create a standard timing system so that I can
measure ~how
long each function takes to execute.
I wish to be able to place at the start of a function
version(Time) mixin TimeExecutio
On 2013-01-14 11:44, mist wrote:
What is the rationale behind this limitation?
I'm not sure but it might have something to do with template mixins
introduce a new scope or similar.
--
/Jacob Carlborg
On 01/14/2013 04:44 AM, mist wrote:
It appears that you cannot mixin *any* statement with
scope([exit,success,etc]) in it.
I have been rereading my copy of TDPL, and it states that mixin
statements must be valid D code, and there can be multiple 'scope()'
statements.
Since "scope(exit) writeln
It appears that you cannot mixin *any* statement with
scope([exit,success,etc]) in it.
I have been rereading my copy of TDPL, and it states that mixin
statements must be valid D code, and there can be multiple
'scope()'
statements.
Since "scope(exit) writeln();" is valid D code, and refuses t
On 01/14/2013 02:03 AM, Timon Gehr wrote:
On 01/14/2013 07:26 AM, 1100110 wrote:
On 01/13/2013 11:35 PM, 1100110 wrote:
Ok, I wish to create a standard timing system so that I can measure ~how
long each function takes to execute.
I wish to be able to place at the start of a function
version(Ti
On 01/14/2013 07:26 AM, 1100110 wrote:
On 01/13/2013 11:35 PM, 1100110 wrote:
Ok, I wish to create a standard timing system so that I can measure ~how
long each function takes to execute.
I wish to be able to place at the start of a function
version(Time) mixin TimeExecution("funcName");
mixin
On 01/13/2013 11:35 PM, 1100110 wrote:
Ok, I wish to create a standard timing system so that I can measure ~how
long each function takes to execute.
I wish to be able to place at the start of a function
version(Time) mixin TimeExecution("funcName");
mixin template TimeExecution(T) if(isSomeStri
Ok, I wish to create a standard timing system so that I can measure
~how long each function takes to execute.
I wish to be able to place at the start of a function
version(Time) mixin TimeExecution("funcName");
mixin template TimeExecution(T) if(isSomeString!T) {
import std.stdio, std.date
10 matches
Mail list logo