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

Commit

Permalink
Change name from RTTypeid to __typeid
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex committed Jul 28, 2020
1 parent 1a76c5b commit ca856ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class TypeInfo
/*
Run-time type information for scalar types (int for now).
*/
template RTTypeid(T)
template __typeid(T)
if (is(T == int))
{
class Impl : TypeInfo
Expand Down Expand Up @@ -490,12 +490,12 @@ if (is(T == int))
}

// On-demand singleton object in static storage
immutable RTTypeid = new Impl;
immutable __typeid = new Impl;
}

unittest
{
alias id = RTTypeid!int;
alias id = __typeid!int;
static assert(id == id && id <= id && id >= id);
static assert(id.toString == "int");
int a = 42, b = 42, c = 43;
Expand Down

0 comments on commit ca856ef

Please sign in to comment.