Search

January 30, 2011
General »
...RAII.

classes are reference types with inheritance and polymorphism. They don't really support RAII...
January 27, 2011
General »
...to learn D. The main reasons were RAII and Design by Contract. Even funnier, it...
January 26, 2011
General »
...use clear() you will have to enforce RAII using structs (not garbage collected) or finally...
January 23, 2011
Learn »
Ah, I keep forgetting about opCall. Nice tips there.
January 23, 2011
Learn »
A static opCall would be better. See my answer to the original post.

-- 
/Jacob Carlborg
January 23, 2011
Learn »
You can use a static opCall, like this:

struct Foo
{
    static Foo opCall ()
    {
        Foo foo...
January 23, 2011
Learn »
The typical thing to do when you want a default constructor for a struct is...
January 23, 2011
Learn »
...believe that they work properly for normal RAII), but in particular, for the moment, don...
January 23, 2011
Learn »
Actually this becomes rather annoying, since I can't use any closures on the object...
January 23, 2011
Learn »
A workaround:

import std.stdio;
import std.exception;

struct A
{
    int x;

    this(void* none...
82 83 84 85 86 87 88 89 90 91 92 93
Next ›   Last »