Just noticed something interesting in the std.allocator source, right at the very bottom. An EOF and some code? Does the compiler stop at the EOF? If so why add code beyond that? Also version(none), eh?

https://github.com/andralex/phobos/blob/allocator/std/allocator.d#L4071

What's going on there?

...
__EOF__

version(none) struct TemplateAllocator
{
    enum alignment = platformAlignment;
    static size_t goodAllocSize(size_t s)
    {
    }
    void[] allocate(size_t)
    {
    }
    bool owns(void[])
    {
    }
    bool expand(ref void[] b, size_t)
    {
    }
    bool reallocate(ref void[] b, size_t)
    {
    }
    void deallocate(void[] b)
    {
    }
    void deallocateAll()
    {
    }
    void[] allocateAll()
    {
    }
    static shared TemplateAllocator it;
}

Reply via email to