Menu
Home
Create new Paste
Log in
template static array
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
import std.stdio; void receive(alias n, T)(T[n] vals) { writeln(typeof(vals).stringof); } void receive2(T)(/*static */T vals) { writeln(typeof(vals).stringof); } void main() { receive!(3, int)([1, 2, 3]); receive!(4, int)([1, 2, 3, 4]); //receive!(3, int)([1, 2, 3, 4]); receive!(3, char)(['a', 'b', 'c']); writeln("----"); receive2([1, 2, 3]); receive2([1, 2, 3, 4]); receive2(['a', 'b', 'c']); }
Result:
Success
/
Return code: 0
/
Compilation time:
0.37
seconds
/
Run time:
0.001
seconds
Disassembly
Application output:
int[3LU]
int[4LU]
char[3LU]
----
int[]
int[]
char[]
Username
Message
Add comment
Paste info
Author:
Namespace
Views:
117
Private:
no
Expires:
Never
Uploaded:
15.10.12 15:57
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.060
Pointer size:
m64
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason