use of struct vs class

Steven Schveighoffer schveiguy at gmail.com
Sat Mar 7 14:30:58 UTC 2020


On 3/7/20 8:22 AM, mark wrote:
> 0x0000555555701ef0 in 
> _D3std9container6rbtree__T12RedBlackTreeTAyaVQea5_61203c2062Vbi0ZQBn5emptyMFNaNbNdNiNfZb 
> (this=0x0)
>      at 
> /home/mark/opt/ldc2-1.20.0-linux-x86_64/bin/../import/std/container/rbtree.d:967 
> 
> 967            return _end.left is null;
> (gdb) bt
> #0  0x0000555555701ef0 in 
> _D3std9container6rbtree__T12RedBlackTreeTAyaVQea5_61203c2062Vbi0ZQBn5emptyMFNaNbNdNiNfZb 
> (this=0x0)

RedBlackTree is a class. Make sure you allocate it. The above shows 
"this = 0x0".

I saw a few other "this = 0x0" items, but perhaps that's OK for your 
code, I don't know what those types are.

-Steve


More information about the Digitalmars-d-learn mailing list