Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 873fda8

Browse files
authored
Merge pull request #2768 from JinShil/move_hooks
Demphasize runtime hooks in object.d's documentation merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2 parents 1165b5a + 0d54d05 commit 873fda8

File tree

1 file changed

+105
-105
lines changed

1 file changed

+105
-105
lines changed

src/object.d

Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -38,117 +38,12 @@ alias dstring = immutable(dchar)[];
3838

3939
version (D_ObjectiveC) public import core.attribute : selector;
4040

41-
/// See $(REF _d_cmain, core,internal,entrypoint)
42-
public import core.internal.entrypoint : _d_cmain;
43-
44-
/// See $(REF _d_arrayappendTImpl, core,internal,array,appending)
45-
public import core.internal.array.appending : _d_arrayappendTImpl;
46-
/// See $(REF _d_arrayappendcTXImpl, core,internal,array,appending)
47-
public import core.internal.array.appending : _d_arrayappendcTXImpl;
48-
/// See $(REF __cmp, core,internal,array,comparison)
49-
public import core.internal.array.comparison : __cmp;
50-
/// See $(REF __equals, core,internal,array,equality)
51-
public import core.internal.array.equality : __equals;
52-
/// See $(REF __ArrayEq, core,internal,array,equality)
53-
public import core.internal.array.equality : __ArrayEq;
54-
/// See $(REF __ArrayCast, core,internal,array,casting)
55-
public import core.internal.array.casting: __ArrayCast;
56-
/// See $(REF _d_arraycatnTXImpl, core,internal,array,concatenation)
57-
public import core.internal.array.concatenation : _d_arraycatnTXImpl;
58-
/// See $(REF _d_arrayctor, core,internal,array,construction)
59-
public import core.internal.array.construction : _d_arrayctor;
60-
/// See $(REF _d_arraysetctor, core,internal,array,construction)
61-
public import core.internal.array.construction : _d_arraysetctor;
62-
6341
/// See $(REF capacity, core,internal,array,capacity)
6442
public import core.internal.array.capacity: capacity;
6543
/// See $(REF reserve, core,internal,array,capacity)
6644
public import core.internal.array.capacity: reserve;
6745
/// See $(REF assumeSafeAppend, core,internal,array,capacity)
6846
public import core.internal.array.capacity: assumeSafeAppend;
69-
/// See $(REF _d_arraysetlengthTImpl, core,internal,array,capacity)
70-
public import core.internal.array.capacity: _d_arraysetlengthTImpl;
71-
72-
/// See $(REF _d_assert_fail, core,internal,dassert)
73-
public import core.internal.dassert: _d_assert_fail;
74-
75-
/// See $(REF __switch, core,internal,switch_)
76-
public import core.internal.switch_: __switch;
77-
/// See $(REF __switch_error, core,internal,switch_)
78-
public import core.internal.switch_: __switch_error;
79-
80-
// Compare class and interface objects for ordering.
81-
private int __cmp(Obj)(Obj lhs, Obj rhs)
82-
if (is(Obj : Object))
83-
{
84-
if (lhs is rhs)
85-
return 0;
86-
// Regard null references as always being "less than"
87-
if (!lhs)
88-
return -1;
89-
if (!rhs)
90-
return 1;
91-
return lhs.opCmp(rhs);
92-
}
93-
94-
// objects
95-
@safe unittest
96-
{
97-
class C
98-
{
99-
int i;
100-
this(int i) { this.i = i; }
101-
102-
override int opCmp(Object c) const @safe
103-
{
104-
return i - (cast(C)c).i;
105-
}
106-
}
107-
108-
auto c1 = new C(1);
109-
auto c2 = new C(2);
110-
assert(__cmp(c1, null) > 0);
111-
assert(__cmp(null, c1) < 0);
112-
assert(__cmp(c1, c1) == 0);
113-
assert(__cmp(c1, c2) < 0);
114-
assert(__cmp(c2, c1) > 0);
115-
116-
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
117-
assert(__cmp([c2, c2], [c1, c1]) > 0);
118-
}
119-
120-
// structs
121-
@safe unittest
122-
{
123-
struct C
124-
{
125-
ubyte i;
126-
this(ubyte i) { this.i = i; }
127-
}
128-
129-
auto c1 = C(1);
130-
auto c2 = C(2);
131-
132-
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
133-
assert(__cmp([c2, c2], [c1, c1]) > 0);
134-
assert(__cmp([c2, c2], [c2, c1]) > 0);
135-
}
136-
137-
@safe unittest
138-
{
139-
auto a = "hello"c;
140-
141-
assert(a > "hel");
142-
assert(a >= "hel");
143-
assert(a < "helloo");
144-
assert(a <= "helloo");
145-
assert(a > "betty");
146-
assert(a >= "betty");
147-
assert(a == "hello");
148-
assert(a <= "hello");
149-
assert(a >= "hello");
150-
assert(a < "я");
151-
}
15247

15348
/**
15449
* Recursively calls the `opPostMove` callbacks of a struct and its members if
@@ -4178,3 +4073,108 @@ void __ArrayDtor(T)(T[] a)
41784073
foreach_reverse (ref T e; a)
41794074
e.__xdtor();
41804075
}
4076+
4077+
/// See $(REF _d_cmain, core,internal,entrypoint)
4078+
public import core.internal.entrypoint : _d_cmain;
4079+
4080+
/// See $(REF _d_arrayappendTImpl, core,internal,array,appending)
4081+
public import core.internal.array.appending : _d_arrayappendTImpl;
4082+
/// See $(REF _d_arrayappendcTXImpl, core,internal,array,appending)
4083+
public import core.internal.array.appending : _d_arrayappendcTXImpl;
4084+
/// See $(REF __cmp, core,internal,array,comparison)
4085+
public import core.internal.array.comparison : __cmp;
4086+
/// See $(REF __equals, core,internal,array,equality)
4087+
public import core.internal.array.equality : __equals;
4088+
/// See $(REF __ArrayEq, core,internal,array,equality)
4089+
public import core.internal.array.equality : __ArrayEq;
4090+
/// See $(REF __ArrayCast, core,internal,array,casting)
4091+
public import core.internal.array.casting: __ArrayCast;
4092+
/// See $(REF _d_arraycatnTXImpl, core,internal,array,concatenation)
4093+
public import core.internal.array.concatenation : _d_arraycatnTXImpl;
4094+
/// See $(REF _d_arrayctor, core,internal,array,construction)
4095+
public import core.internal.array.construction : _d_arrayctor;
4096+
/// See $(REF _d_arraysetctor, core,internal,array,construction)
4097+
public import core.internal.array.construction : _d_arraysetctor;
4098+
/// See $(REF _d_arraysetlengthTImpl, core,internal,array,capacity)
4099+
public import core.internal.array.capacity: _d_arraysetlengthTImpl;
4100+
4101+
/// See $(REF _d_assert_fail, core,internal,dassert)
4102+
public import core.internal.dassert: _d_assert_fail;
4103+
4104+
/// See $(REF __switch, core,internal,switch_)
4105+
public import core.internal.switch_: __switch;
4106+
/// See $(REF __switch_error, core,internal,switch_)
4107+
public import core.internal.switch_: __switch_error;
4108+
4109+
// Compare class and interface objects for ordering.
4110+
private int __cmp(Obj)(Obj lhs, Obj rhs)
4111+
if (is(Obj : Object))
4112+
{
4113+
if (lhs is rhs)
4114+
return 0;
4115+
// Regard null references as always being "less than"
4116+
if (!lhs)
4117+
return -1;
4118+
if (!rhs)
4119+
return 1;
4120+
return lhs.opCmp(rhs);
4121+
}
4122+
4123+
// objects
4124+
@safe unittest
4125+
{
4126+
class C
4127+
{
4128+
int i;
4129+
this(int i) { this.i = i; }
4130+
4131+
override int opCmp(Object c) const @safe
4132+
{
4133+
return i - (cast(C)c).i;
4134+
}
4135+
}
4136+
4137+
auto c1 = new C(1);
4138+
auto c2 = new C(2);
4139+
assert(__cmp(c1, null) > 0);
4140+
assert(__cmp(null, c1) < 0);
4141+
assert(__cmp(c1, c1) == 0);
4142+
assert(__cmp(c1, c2) < 0);
4143+
assert(__cmp(c2, c1) > 0);
4144+
4145+
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
4146+
assert(__cmp([c2, c2], [c1, c1]) > 0);
4147+
}
4148+
4149+
// structs
4150+
@safe unittest
4151+
{
4152+
struct C
4153+
{
4154+
ubyte i;
4155+
this(ubyte i) { this.i = i; }
4156+
}
4157+
4158+
auto c1 = C(1);
4159+
auto c2 = C(2);
4160+
4161+
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
4162+
assert(__cmp([c2, c2], [c1, c1]) > 0);
4163+
assert(__cmp([c2, c2], [c2, c1]) > 0);
4164+
}
4165+
4166+
@safe unittest
4167+
{
4168+
auto a = "hello"c;
4169+
4170+
assert(a > "hel");
4171+
assert(a >= "hel");
4172+
assert(a < "helloo");
4173+
assert(a <= "helloo");
4174+
assert(a > "betty");
4175+
assert(a >= "betty");
4176+
assert(a == "hello");
4177+
assert(a <= "hello");
4178+
assert(a >= "hello");
4179+
assert(a < "я");
4180+
}

0 commit comments

Comments
 (0)