view tests/mini/arrays16.d @ 797:340acf1535d0

Removed KDevelop3 project files, CMake can generate them just fine! Fixed function literals in static initializers. Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE. Changed errors to go to stderr instead of stdout. Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sat, 29 Nov 2008 21:25:43 +0100
parents 23538d0f0d5b
children
line wrap: on
line source

module mini.arrays16;

void main()
{
    intarrays!(byte)();
    intarrays!(ubyte)();
    intarrays!(short)();
    intarrays!(ushort)();
    intarrays!(int)();
    intarrays!(uint)();
    intarrays!(long)();
    intarrays!(ulong)();
}

void intarrays(T)()
{
    T[] ia = [cast(T)1,2,3,4];
    T[] ib = [cast(T)1,2,3,4];
    T[] ic = [cast(T)1,2,3];
    T[] id = [cast(T)1,2,3,4,5];

    assert(ia == ia);
    assert(ia == ib);
    assert(ia != ic);
    assert(ia != id);
    assert(ia > ic);
    assert(ia !< ic);
    assert(ia < id);
    assert(ia !> id);
}