Changeset 1776
- Timestamp:
- 07/22/10 15:33:04 (3 years ago)
- Files:
-
- trunk/phobos/std/typecons.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phobos/std/typecons.d
r1775 r1776 2285 2285 alias Scoped_payload this; 2286 2286 2287 this(Args...)(Args args) if (is(typeof(T.init.__ctor(args))))2288 {2289 emplace!T(cast(void[]) Scoped_store, args);2290 }2291 2292 2287 @disable this(this) { writeln("Scoped this(this)"); assert(false); } 2293 2288 … … 2301 2296 } 2302 2297 2298 byte[__traits(classInstanceSize, T)] result; 2303 2299 static if (Args.length == 0) 2304 2300 { 2305 byte[__traits(classInstanceSize, T)] result;2306 2301 result[] = typeid(T).init[]; 2307 2302 static if (is(typeof(T.init.__ctor()))) … … 2309 2304 (cast(T) result.ptr).__ctor(); 2310 2305 } 2311 return cast(Scoped) result;2312 2306 } 2313 2307 else 2314 2308 { 2315 return Scoped(args); 2316 } 2309 emplace!T(cast(void[]) result, args); 2310 } 2311 return cast(Scoped) result; 2317 2312 } 2318 2313
