Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
import std.stdio; class vec(T, const ubyte dim) { public: T[dim] values; this(U...)(U values) { foreach (index, val; values) { this.values[index] = cast(T) val; } } static vec!(T, dim) opCall(U...)(U values) { return new vec!(T, dim)(values); } static vec!(T, dim) opCall(U, ubyte dim)(const vec!(U, dim) v) { return vec!(T, dim)(v.values[]); } vec!(T, dim) Clone() const { return vec!(T, dim)(this); } } alias vec!(float, 2) vec2f; void main() { vec2f(42, 23); }
Result:
Compilation error
/
Return code: 1 (Hangup)
/
Compilation time:
0.702
seconds
Compilation output:
/home/c878/c982.d(9): Error: e2ir: cannot cast val of type const(float)[] to type float
Username
Message
Add comment
Paste info
Author:
Namespace
Views:
181
Private:
no
Expires:
Never
Uploaded:
04.08.12 17:31
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.062
Pointer size:
m64
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason