How about a new property for class and struct to get the fully qualified name?
Meta
jared771 at gmail.com
Fri Jul 17 15:11:30 UTC 2020
On Friday, 17 July 2020 at 02:44:52 UTC, Heromyth wrote:
> How about a new property for class and struct like `.stringof`
> to get the fully qualified name?
>
> I know the `fullyQualifiedName` can do this. If a new property
> like `.qualifiedName` added to class and struct, the code blown:
>
> @Middleware(fullyQualifiedName!(IpFilterMiddleware),
> fullyQualifiedName!(BasicAuthMiddleware))
> @Action string security() {
> return "It's a security page.";
> }
>
> may be changed as:
>
> @Middleware(IpFilterMiddleware.qualifiedName,
> BasicAuthMiddleware.qualifiedName)
> @Action string security() {
> return "It's a security page.";
> }
>
> It looks better, does it?
Note that you can also make an alias for fullyQualifiedName:
import fqn = std.traits: fullyQualifiedName;
More information about the Digitalmars-d
mailing list