Skip to content

D does not offer RAII #27

@carun

Description

@carun

D offers only scoped destruction and not resource acquisition is initialization. Basically the resource is not always acquired during initialization as struct in D can't have default constructors. Library implementations like Automem makes using RAII in D as easy as C++, but only for heap memory and not for all kinds of resources (like mutex, etc). It is unfair to say that D supports RAII. Its RAII is nowhere close to what C++ offers that it shouldn't be called RAII by definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions