2 * Provide the root object that classes in dmd inherit from.
4 * Copyright: Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
5 * Authors: Walter Bright, http://www.digitalmars.com
6 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
7 * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/root/rootobject.d, root/_rootobject.d)
8 * Documentation: https://dlang.org/phobos/dmd_root_rootobject.html
9 * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/root/rootobject.d
12 module dmd
.root
.rootobject
;
14 import core
.stdc
.stdio
;
16 import dmd
.common
.outbuffer
;
18 /***********************************************************
36 /***********************************************************
39 extern (C
++) class RootObject
41 this() nothrow pure @nogc @safe
45 bool equals(const RootObject o
) const
50 const(char)* toChars() const
56 extern(D
) const(char)[] toString() const
58 import core
.stdc
.string
: strlen
;
59 auto p
= this.toChars();
60 return p
[0 .. strlen(p
)];
63 DYNCAST
dyncast() const nothrow pure @nogc @safe
65 return DYNCAST
.object
;