Replace 'body' with 'do'
This commit is contained in:
parent
490a2519a1
commit
bccd494072
|
@ -107,11 +107,11 @@ struct Channel(T, size_t buffer_size = 100) {
|
||||||
*/
|
*/
|
||||||
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst)
|
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst)
|
||||||
in { assert(dst.empty); }
|
in { assert(dst.empty); }
|
||||||
body { return m_impl.consumeAll(dst); }
|
do { return m_impl.consumeAll(dst); }
|
||||||
/// ditto
|
/// ditto
|
||||||
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst) shared
|
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst) shared
|
||||||
in { assert(dst.empty); }
|
in { assert(dst.empty); }
|
||||||
body { return m_impl.consumeAll(dst); }
|
do { return m_impl.consumeAll(dst); }
|
||||||
|
|
||||||
/** Enqueues an element.
|
/** Enqueues an element.
|
||||||
|
|
||||||
|
|
|
@ -505,7 +505,7 @@ private struct IsolatedArray(T)
|
||||||
//assert(isSorted(indices), "Indices must be in ascending order.");
|
//assert(isSorted(indices), "Indices must be in ascending order.");
|
||||||
assert(indices[$-1] <= m_array.length, "Splice index out of bounds.");
|
assert(indices[$-1] <= m_array.length, "Splice index out of bounds.");
|
||||||
}
|
}
|
||||||
body {
|
do {
|
||||||
auto ret = new IsolatedArray!T[indices.length];
|
auto ret = new IsolatedArray!T[indices.length];
|
||||||
size_t lidx = 0;
|
size_t lidx = 0;
|
||||||
foreach( i, sidx; indices ){
|
foreach( i, sidx; indices ){
|
||||||
|
@ -521,7 +521,7 @@ private struct IsolatedArray(T)
|
||||||
assert(array.m_array.ptr == m_array.ptr+m_array.length || array.m_array.ptr+array.length == m_array.ptr,
|
assert(array.m_array.ptr == m_array.ptr+m_array.length || array.m_array.ptr+array.length == m_array.ptr,
|
||||||
"Argument to merge() must be a neighbouring array partition.");
|
"Argument to merge() must be a neighbouring array partition.");
|
||||||
}
|
}
|
||||||
body {
|
do {
|
||||||
if( array.m_array.ptr == m_array.ptr + m_array.length ){
|
if( array.m_array.ptr == m_array.ptr + m_array.length ){
|
||||||
m_array = m_array.ptr[0 .. m_array.length + array.length];
|
m_array = m_array.ptr[0 .. m_array.length + array.length];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1019,7 +1019,7 @@ nothrow {
|
||||||
*/
|
*/
|
||||||
@property size_t workerThreadCount()
|
@property size_t workerThreadCount()
|
||||||
out(count) { assert(count > 0, "No worker threads started after setupWorkerThreads!?"); }
|
out(count) { assert(count > 0, "No worker threads started after setupWorkerThreads!?"); }
|
||||||
body {
|
do {
|
||||||
setupWorkerThreads();
|
setupWorkerThreads();
|
||||||
synchronized (st_threadsMutex)
|
synchronized (st_threadsMutex)
|
||||||
return st_workerPool.threadCount;
|
return st_workerPool.threadCount;
|
||||||
|
@ -1253,7 +1253,7 @@ struct Timer {
|
||||||
*/
|
*/
|
||||||
void rearm(Duration dur, bool periodic = false) nothrow
|
void rearm(Duration dur, bool periodic = false) nothrow
|
||||||
in { assert(dur >= 0.seconds, "Negative timer duration specified."); }
|
in { assert(dur >= 0.seconds, "Negative timer duration specified."); }
|
||||||
body { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); }
|
do { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); }
|
||||||
|
|
||||||
/** Resets the timer and avoids any firing.
|
/** Resets the timer and avoids any firing.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -365,16 +365,16 @@ struct NetworkAddress {
|
||||||
|
|
||||||
@property inout(sockaddr_in)* sockAddrInet4() inout pure nothrow
|
@property inout(sockaddr_in)* sockAddrInet4() inout pure nothrow
|
||||||
in { assert (family == AF_INET); }
|
in { assert (family == AF_INET); }
|
||||||
body { return &addr_ip4; }
|
do { return &addr_ip4; }
|
||||||
|
|
||||||
@property inout(sockaddr_in6)* sockAddrInet6() inout pure nothrow
|
@property inout(sockaddr_in6)* sockAddrInet6() inout pure nothrow
|
||||||
in { assert (family == AF_INET6); }
|
in { assert (family == AF_INET6); }
|
||||||
body { return &addr_ip6; }
|
do { return &addr_ip6; }
|
||||||
|
|
||||||
version (Posix) {
|
version (Posix) {
|
||||||
@property inout(sockaddr_un)* sockAddrUnix() inout pure nothrow
|
@property inout(sockaddr_un)* sockAddrUnix() inout pure nothrow
|
||||||
in { assert (family == AddressFamily.UNIX); }
|
in { assert (family == AddressFamily.UNIX); }
|
||||||
body { return &addr_unix; }
|
do { return &addr_unix; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a string representation of the IP address
|
/** Returns a string representation of the IP address
|
||||||
|
|
|
@ -190,7 +190,7 @@ in {
|
||||||
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
|
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
|
||||||
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
|
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
|
||||||
|
|
||||||
} body {
|
} do {
|
||||||
enum classSize = __traits(classInstanceSize, T);
|
enum classSize = __traits(classInstanceSize, T);
|
||||||
auto result = () @trusted { return cast(T) chunk.ptr; } ();
|
auto result = () @trusted { return cast(T) chunk.ptr; } ();
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ in {
|
||||||
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
|
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
|
||||||
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
|
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
|
||||||
|
|
||||||
} body {
|
} do {
|
||||||
return emplace(() @trusted { return cast(T*)chunk.ptr; } (), args);
|
return emplace(() @trusted { return cast(T*)chunk.ptr; } (), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue