Decompressing bzip2
Charles Hixson via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 5 12:27:20 PDT 2016
On 04/04/2016 04:38 PM, Mike Parker via Digitalmars-d-learn wrote:
> On Monday, 4 April 2016 at 21:32:10 UTC, stunaep wrote:
>
>> Can you please explain what the scope keyword does and if there
>
> scope was originally intended to be used primarily with classes in
> order to get deterministic destruction. It ensures the destructor of a
> class is called when the scope exits, just as with a struct. It's not
> needed here and shouldn't really be used at all anymore. It has been
> superseded by std.typecons.scoped [1]. It's not needed here at all,
> though. bz_stream is a struct, so there's no need to allocate an
> instance of it:
...
Are you asserting that scope is soon to be officially deprecated? I'm
finding "shouldn't really be used at all anymore" a bit of a worrying
statement, as I much prefer the syntax used by scope. Why shouldn't it
"be used at all anymore"?
More information about the Digitalmars-d-learn
mailing list