From 9cfb702f0bfa54444e05b8481612b225f53c48bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sat, 5 Nov 2016 01:41:15 +0100 Subject: [PATCH] Fix deprecation warnings. --- source/vibe/internal/memory.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/vibe/internal/memory.d b/source/vibe/internal/memory.d index 66a11c2..99bc690 100644 --- a/source/vibe/internal/memory.d +++ b/source/vibe/internal/memory.d @@ -845,7 +845,10 @@ private T internalEmplace(T, Args...)(void[] chunk, auto ref Args args) auto result = () @trusted { return cast(T) chunk.ptr; } (); // Initialize the object in its pre-ctor state - () @trusted { chunk[0 .. classSize] = typeid(T).init[]; } (); + static if (__VERSION__ < 2071) + () @trusted { return chunk[0 .. classSize] = typeid(T).init[]; } (); + else + () @trusted { return chunk[0 .. classSize] = typeid(T).initializer[]; } (); // Avoid deprecation warning // Call the ctor if any static if (is(typeof(result.__ctor(args)))) @@ -872,7 +875,7 @@ in { format("emplace: Chunk size too small: %s < %s size = %s", chunk.length, T.stringof, T.sizeof)); assert((cast(size_t) chunk.ptr) % T.alignof == 0, - format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", chunk.ptr, T.alignof, T.stringof)); + format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof)); } body { return emplace(() @trusted { return cast(T*)chunk.ptr; } (), args);