comparison d2/qtd/Array.d @ 314:80b52f5e97b6 lifetime

Structure without common root dir
author maxter <spambox@d-coding.com>
date Wed, 23 Dec 2009 23:17:36 +0200
parents 8674fd5f34f4
children
comparison
equal deleted inserted replaced
313:cb7fb9195175 314:80b52f5e97b6
7 * Copyright QtD Team, 2008-2009 7 * Copyright QtD Team, 2008-2009
8 * Distributed under the Boost Software License, Version 1.0. 8 * Distributed under the Boost Software License, Version 1.0.
9 * (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 * (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 * 10 *
11 */ 11 */
12 module qt.Array; 12 module qtd.Array;
13 13
14 import 14 import
15 core.stdc.string, 15 core.stdc.string,
16 qt.Memory; 16 qtd.Memory;
17 17
18 void append(alias alloc = GCAlloc, T)(ref T[] array, T elem) 18 void append(alias alloc = GCAlloc, T)(ref T[] array, T elem)
19 { 19 {
20 auto newLen = array.length + 1; 20 auto newLen = array.length + 1;
21 alloc.realloc(array.ptr, newLen * T.sizeof); 21 alloc.realloc(array.ptr, newLen * T.sizeof);