Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
import core.stdc.stdio; struct UniquePtr { private int m_i; @disable this(); @disable this(this); this(int i) { m_i = i; } ~this() { printf("deleting %d", m_i); } } UniquePtr test1() { auto u = UniquePtr(5); return u; } /* UniquePtr test2(UniquePtr u) { return u; // error 1 here } */ void main(string[] args) { auto u = test1(); //u = test2(u); // error 2 here }
Result:
Success
/
Return code: 0
Application output:
deleting 5
Paste info
Author:
Guest
Views:
1925
Private:
no
Expires:
Never
Uploaded:
22.12.13 14:16
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.079.1 ( 2.079.1 )
Pointer size:
m64
Actions
Download
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason