The spec doesn't mention anything about block statements in typeof
declarations.
//typeof({1}) a; // found } expecting ;
//typeof({1}()) b; // same as a
typeof(1) c; // int
I'm asking because isInputRange from std.range the idom from the b test:
template isInputRange(R
On Thu, 12 Aug 2010 09:13:54 -0400, simendsjo simen.end...@pandavre.com
wrote:
The spec doesn't mention anything about block statements in typeof
declarations.
//typeof({1}) a; // found } expecting ;
//typeof({1}()) b; // same as a
typeof(1) c; // int
Am 12.08.2010 15:13, schrieb simendsjo:
The spec doesn't mention anything about block statements in typeof
declarations.
//typeof({1}) a; // found } expecting ;
//typeof({1}()) b; // same as a
typeof(1) c; // int
I'm asking because isInputRange from std.range the idom from the b test
12.08.2010 17:13, simendsjo wrote:
The spec doesn't mention anything about block statements in typeof
declarations.
//typeof({1}) a; // found } expecting ;
//typeof({1}()) b; // same as a
typeof(1) c; // int
I'm asking because isInputRange from std.range the idom from the b test
On 12.08.2010 15:30, Steven Schveighoffer wrote:
On Thu, 12 Aug 2010 09:13:54 -0400, simendsjo
simen.end...@pandavre.com wrote:
The spec doesn't mention anything about block statements in typeof
declarations.
//typeof({1}) a; // found } expecting ;
//typeof({1}()) b; // same as a
typeof(1) c
about block statements in typeof
declarations.
//typeof({1}) a; // found } expecting ;
//typeof({1}()) b; // same as a
typeof(1) c; // int
{...} is a function literal, a lambda function if you will.
I thought parameterless delegates were written () {}..
Your lambda function contains a syntax
On Thu, 12 Aug 2010 10:29:41 -0400, simendsjo simen.end...@pandavre.com
wrote:
On 12.08.2010 16:19, Steven Schveighoffer wrote:
On Thu, 12 Aug 2010 09:56:07 -0400, simendsjo
simen.end...@pandavre.com wrote:
Why doesn't this work then?
typeof({return 1;}()) a; // found 'a' when expecting
On 12.08.2010 16:39, Steven Schveighoffer wrote:
(...)
Tested with dmd 2.048 on win7.
pragma(msg, module:~typeof({return 1;}()).stringof);
void main()
{
pragma(msg, main:~typeof({return 1;}()).stringof);
//typeof({return 1;}()) a; // found 'a' when expecting ';' following
statement
}
prints