Yess.but there are LOTS of nodes/BTree, and each node would need to
check whether the btFile was already initialized, et (ugh!) cetera. So
while possible, that's an even worse answer than depending on people
closing the BTree properly. I *am* going to separate the close routine
from the
The class Node is contained within the struct BTree.
The field btFile is contained within the struct BTree.
The statement is within a function within the Node class.
I've tried many variations, here are a few:
btFile.write(self.nodeId, cast(void*)(self));
results in:
need 'this' for 'btFile'
On Wednesday, 1 April 2015 at 18:26:49 UTC, Charles Hixson wrote:
Perhaps BTree needs to be a class?
yes
On 04/01/2015 11:39 AM, anonymous via Digitalmars-d-learn wrote:
On Wednesday, 1 April 2015 at 18:26:49 UTC, Charles Hixson wrote:
Perhaps BTree needs to be a class?
yes
Thanks.
Sigh. I was hoping to preserve the determinate closing that one gets
with a struct.
On Wednesday, 1 April 2015 at 18:26:49 UTC, Charles Hixson wrote:
Perhaps BTree needs to be a class? I made it a struct because
I want it to definitely close properly when it
goes out of scope.
Maybe `scoped` can help:
http://dlang.org/phobos/std_typecons.html#.scoped
On 04/01/2015 11:25 AM, Charles Hixson via Digitalmars-d-learn wrote:
The class Node is contained within the struct BTree.
The field btFile is contained within the struct BTree.
The statement is within a function within the Node class.
I've tried many variations, here are a few: