Merge pull request #16 from drug007/patch-1

String literal reduces memory allocation.
This commit is contained in:
Sönke Ludwig 2018-09-30 10:15:42 +02:00 committed by GitHub
commit debe058a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -941,7 +941,8 @@ private static auto implementOp(OpKind kind, string name, T, ARGS...)(ref T self
//import std.meta : staticMap; pragma(msg, staticMap!(isMatchingUniqueType!(T.Union), info.ReturnTypes));
switch (self.m_kind) {
default: assert(false, "Operator "~name~" ("~kind.stringof~") can only be used on values of the following types: "~[info.fields].join(", "));
enum assert_msg = "Operator "~name~" ("~kind.stringof~") can only be used on values of the following types: "~[info.fields].join(", ");
default: assert(false, assert_msg);
foreach (i, f; info.fields) {
alias FT = typeof(__traits(getMember, T.Union, f));
case __traits(getMember, T.Kind, f):