mirror of
https://github.com/dlang/phobos.git
synced 2025-04-26 13:10:35 +03:00
[dmd-cxx] Simplify some Proxy.opDispatch conditions
This commit is contained in:
parent
63f4caa900
commit
55bb175431
1 changed files with 8 additions and 7 deletions
|
@ -5935,13 +5935,7 @@ mixin template Proxy(alias a)
|
|||
// built-in type field, manifest constant, and static non-mutable field
|
||||
enum opDispatch = mixin("a."~name);
|
||||
}
|
||||
else static if (is(typeof(mixin("a."~name))) || __traits(getOverloads, a, name).length != 0)
|
||||
{
|
||||
// field or property function
|
||||
@property auto ref opDispatch(this X)() { return mixin("a."~name); }
|
||||
@property auto ref opDispatch(this X, V)(auto ref V v) { return mixin("a."~name~" = v"); }
|
||||
}
|
||||
else
|
||||
else static if (__traits(isTemplate, mixin("a."~name)))
|
||||
{
|
||||
// member template
|
||||
template opDispatch(T...)
|
||||
|
@ -5950,6 +5944,13 @@ mixin template Proxy(alias a)
|
|||
auto ref opDispatch(this X, Args...)(auto ref Args args){ return mixin("a."~name~targs~"(args)"); }
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// field or property function
|
||||
@property auto ref opDispatch(this X)() { return mixin("a."~name); }
|
||||
@property auto ref opDispatch(this X, V)(auto ref V v) { return mixin("a."~name~" = v"); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import std.traits : isArray;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue