/usr/lib/gcc-cross/arm-linux-gnueabi/5/include/d/core/internal/traits.d is in libphobos-5-dev-armel-cross 5.3.1-14ubuntu2cross1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | /**
* Contains traits for runtime internal usage.
*
* Copyright: Copyright Digital Mars 2014 -.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Martin Nowak
* Source: $(DRUNTIMESRC core/internal/_traits.d)
*/
module core.internal.traits;
/// taken from std.typetuple.TypeTuple
template TypeTuple(TList...)
{
alias TypeTuple = TList;
}
T trustedCast(T, U)(auto ref U u) @trusted pure nothrow
{
return cast(T)u;
}
template Unconst(T)
{
static if (is(T U == immutable U)) alias Unconst = U;
else static if (is(T U == inout const U)) alias Unconst = U;
else static if (is(T U == inout U)) alias Unconst = U;
else static if (is(T U == const U)) alias Unconst = U;
else alias Unconst = T;
}
/// taken from std.traits.Unqual
template Unqual(T)
{
version (none) // Error: recursive alias declaration @@@BUG1308@@@
{
static if (is(T U == const U)) alias Unqual = Unqual!U;
else static if (is(T U == immutable U)) alias Unqual = Unqual!U;
else static if (is(T U == inout U)) alias Unqual = Unqual!U;
else static if (is(T U == shared U)) alias Unqual = Unqual!U;
else alias Unqual = T;
}
else // workaround
{
static if (is(T U == immutable U)) alias Unqual = U;
else static if (is(T U == shared inout const U)) alias Unqual = U;
else static if (is(T U == shared inout U)) alias Unqual = U;
else static if (is(T U == shared const U)) alias Unqual = U;
else static if (is(T U == shared U)) alias Unqual = U;
else static if (is(T U == inout const U)) alias Unqual = U;
else static if (is(T U == inout U)) alias Unqual = U;
else static if (is(T U == const U)) alias Unqual = U;
else alias Unqual = T;
}
}
/// used to declare an extern(D) function that is defined in a different module
template externDFunc(string fqn, T:FT*, FT) if(is(FT == function))
{
static if (is(FT RT == return) && is(FT Args == function))
{
import core.demangle : mangleFunc;
enum decl = {
string s = "extern(D) RT bug13050(Args)";
foreach (attr; __traits(getFunctionAttributes, FT))
s ~= " " ~ attr;
return s ~ ";";
}();
pragma(mangle, mangleFunc!T(fqn)) mixin(decl);
alias externDFunc = bug13050;
}
else
static assert(0);
}
|