mirror of
https://github.com/dlang/phobos.git
synced 2025-05-04 17:11:26 +03:00
Fix if constraints indentation
This commit is contained in:
parent
47aa7db188
commit
8f86a0d734
10 changed files with 90 additions and 76 deletions
|
@ -430,7 +430,8 @@ private template isSpawnable(F, T...)
|
||||||
* pointer indirection. This is necessary for enforcing isolation among
|
* pointer indirection. This is necessary for enforcing isolation among
|
||||||
* threads.
|
* threads.
|
||||||
*/
|
*/
|
||||||
Tid spawn(F, T...)(F fn, T args) if (isSpawnable!(F, T))
|
Tid spawn(F, T...)(F fn, T args)
|
||||||
|
if (isSpawnable!(F, T))
|
||||||
{
|
{
|
||||||
static assert(!hasLocalAliasing!(T), "Aliases to mutable thread-local data not allowed.");
|
static assert(!hasLocalAliasing!(T), "Aliases to mutable thread-local data not allowed.");
|
||||||
return _spawn(false, fn, args);
|
return _spawn(false, fn, args);
|
||||||
|
@ -504,7 +505,8 @@ Tid spawn(F, T...)(F fn, T args) if (isSpawnable!(F, T))
|
||||||
* Returns:
|
* Returns:
|
||||||
* A Tid representing the new thread.
|
* A Tid representing the new thread.
|
||||||
*/
|
*/
|
||||||
Tid spawnLinked(F, T...)(F fn, T args) if (isSpawnable!(F, T))
|
Tid spawnLinked(F, T...)(F fn, T args)
|
||||||
|
if (isSpawnable!(F, T))
|
||||||
{
|
{
|
||||||
static assert(!hasLocalAliasing!(T), "Aliases to mutable thread-local data not allowed.");
|
static assert(!hasLocalAliasing!(T), "Aliases to mutable thread-local data not allowed.");
|
||||||
return _spawn(true, fn, args);
|
return _spawn(true, fn, args);
|
||||||
|
@ -513,7 +515,8 @@ Tid spawnLinked(F, T...)(F fn, T args) if (isSpawnable!(F, T))
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Tid _spawn(F, T...)(bool linked, F fn, T args) if (isSpawnable!(F, T))
|
private Tid _spawn(F, T...)(bool linked, F fn, T args)
|
||||||
|
if (isSpawnable!(F, T))
|
||||||
{
|
{
|
||||||
// TODO: MessageList and &exec should be shared.
|
// TODO: MessageList and &exec should be shared.
|
||||||
auto spawnTid = Tid(new MessageBox);
|
auto spawnTid = Tid(new MessageBox);
|
||||||
|
|
|
@ -5974,7 +5974,8 @@ if (isIntegral!T)
|
||||||
Returns the representation of an enumerated value, i.e. the value converted to
|
Returns the representation of an enumerated value, i.e. the value converted to
|
||||||
the base type of the enumeration.
|
the base type of the enumeration.
|
||||||
*/
|
*/
|
||||||
OriginalType!E asOriginalType(E)(E value) if (is(E == enum))
|
OriginalType!E asOriginalType(E)(E value)
|
||||||
|
if (is(E == enum))
|
||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,8 @@ alias CRC64ISO = CRC!(64, 0xD800000000000000);
|
||||||
*
|
*
|
||||||
* See $(D std.digest.digest) for differences between template and OOP API.
|
* See $(D std.digest.digest) for differences between template and OOP API.
|
||||||
*/
|
*/
|
||||||
struct CRC(uint N, ulong P) if (N == 32 || N == 64)
|
struct CRC(uint N, ulong P)
|
||||||
|
if (N == 32 || N == 64)
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static if (N == 32)
|
static if (N == 32)
|
||||||
|
|
24
std/traits.d
24
std/traits.d
|
@ -4647,7 +4647,8 @@ template TemplateArgsOf(T : Base!Args, alias Base, Args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private template maxAlignment(U...) if (isTypeTuple!U)
|
private template maxAlignment(U...)
|
||||||
|
if (isTypeTuple!U)
|
||||||
{
|
{
|
||||||
import std.meta : staticMap;
|
import std.meta : staticMap;
|
||||||
static if (U.length == 0)
|
static if (U.length == 0)
|
||||||
|
@ -4665,7 +4666,8 @@ private template maxAlignment(U...) if (isTypeTuple!U)
|
||||||
/**
|
/**
|
||||||
Returns class instance alignment.
|
Returns class instance alignment.
|
||||||
*/
|
*/
|
||||||
template classInstanceAlignment(T) if (is(T == class))
|
template classInstanceAlignment(T)
|
||||||
|
if (is(T == class))
|
||||||
{
|
{
|
||||||
alias classInstanceAlignment = maxAlignment!(void*, typeof(T.tupleof));
|
alias classInstanceAlignment = maxAlignment!(void*, typeof(T.tupleof));
|
||||||
}
|
}
|
||||||
|
@ -5331,7 +5333,8 @@ Note: Trying to use returned value will result in a
|
||||||
// SomethingTypeOf
|
// SomethingTypeOf
|
||||||
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
|
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
|
||||||
|
|
||||||
private template AliasThisTypeOf(T) if (isAggregateType!T)
|
private template AliasThisTypeOf(T)
|
||||||
|
if (isAggregateType!T)
|
||||||
{
|
{
|
||||||
alias members = AliasSeq!(__traits(getAliasThis, T));
|
alias members = AliasSeq!(__traits(getAliasThis, T));
|
||||||
|
|
||||||
|
@ -7500,7 +7503,8 @@ Returns the largest type, i.e. T such that T.sizeof is the largest. If more
|
||||||
than one type is of the same size, the leftmost argument of these in will be
|
than one type is of the same size, the leftmost argument of these in will be
|
||||||
returned.
|
returned.
|
||||||
*/
|
*/
|
||||||
template Largest(T...) if (T.length >= 1)
|
template Largest(T...)
|
||||||
|
if (T.length >= 1)
|
||||||
{
|
{
|
||||||
static if (T.length == 1)
|
static if (T.length == 1)
|
||||||
{
|
{
|
||||||
|
@ -7731,7 +7735,8 @@ version(unittest) void freeFunc(string);
|
||||||
Aliases itself to $(D T[0]) if the boolean $(D condition) is $(D true)
|
Aliases itself to $(D T[0]) if the boolean $(D condition) is $(D true)
|
||||||
and to $(D T[1]) otherwise.
|
and to $(D T[1]) otherwise.
|
||||||
*/
|
*/
|
||||||
template Select(bool condition, T...) if (T.length == 2)
|
template Select(bool condition, T...)
|
||||||
|
if (T.length == 2)
|
||||||
{
|
{
|
||||||
import std.meta : Alias;
|
import std.meta : Alias;
|
||||||
alias Select = Alias!(T[!condition]);
|
alias Select = Alias!(T[!condition]);
|
||||||
|
@ -8259,7 +8264,8 @@ enum ifTestable(T, alias pred = a => a) = __traits(compiles, { if (pred(T.init))
|
||||||
* Returns:
|
* Returns:
|
||||||
* `true` if `X` is a type, `false` otherwise
|
* `true` if `X` is a type, `false` otherwise
|
||||||
*/
|
*/
|
||||||
template isType(X...) if (X.length == 1)
|
template isType(X...)
|
||||||
|
if (X.length == 1)
|
||||||
{
|
{
|
||||||
enum isType = is(X[0]);
|
enum isType = is(X[0]);
|
||||||
}
|
}
|
||||||
|
@ -8302,7 +8308,8 @@ template isType(X...) if (X.length == 1)
|
||||||
* Use $(LREF isFunctionPointer) or $(LREF isDelegate) for detecting those types
|
* Use $(LREF isFunctionPointer) or $(LREF isDelegate) for detecting those types
|
||||||
* respectively.
|
* respectively.
|
||||||
*/
|
*/
|
||||||
template isFunction(X...) if (X.length == 1)
|
template isFunction(X...)
|
||||||
|
if (X.length == 1)
|
||||||
{
|
{
|
||||||
static if (is(typeof(&X[0]) U : U*) && is(U == function) ||
|
static if (is(typeof(&X[0]) U : U*) && is(U == function) ||
|
||||||
is(typeof(&X[0]) U == delegate))
|
is(typeof(&X[0]) U == delegate))
|
||||||
|
@ -8338,7 +8345,8 @@ template isFunction(X...) if (X.length == 1)
|
||||||
* Returns:
|
* Returns:
|
||||||
* `true` if `X` is final, `false` otherwise
|
* `true` if `X` is final, `false` otherwise
|
||||||
*/
|
*/
|
||||||
template isFinal(X...) if (X.length == 1)
|
template isFinal(X...)
|
||||||
|
if (X.length == 1)
|
||||||
{
|
{
|
||||||
static if (is(X[0] == class))
|
static if (is(X[0] == class))
|
||||||
enum isFinal = __traits(isFinalClass, X[0]);
|
enum isFinal = __traits(isFinalClass, X[0]);
|
||||||
|
|
|
@ -7624,7 +7624,8 @@ final switch (e)
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
*/
|
*/
|
||||||
struct BitFlags(E, Flag!"unsafe" unsafe = No.unsafe) if (unsafe || isBitFlagEnum!(E))
|
struct BitFlags(E, Flag!"unsafe" unsafe = No.unsafe)
|
||||||
|
if (unsafe || isBitFlagEnum!(E))
|
||||||
{
|
{
|
||||||
@safe @nogc pure nothrow:
|
@safe @nogc pure nothrow:
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue