digitalmars.D.learn - how to shorten templates structs name?
- drug (8/8) Oct 10 2017 using classes I can make an inherited class of templated class and avoid...
- Daniel Kozak (3/11) Oct 10 2017 Use alias this
- =?UTF-8?Q?Ali_=c3=87ehreli?= (4/12) Oct 10 2017 I think an alias is more suitable here for both classes and structs:
using classes I can make an inherited class of templated class and avoid
too long mangled name:
```
class TemplatedClass(A, Very, Much, Args, Here) { ... }
class ShortenClass : TemplatedClass!(A,Very, Much, Args, Here) { ... };
```
Now ShortenClass has a nice mangling.
What can be done in case of struct?
Oct 10 2017
Use alias this
Dne 10. 10. 2017 1:30 odpoledne napsal u=C5=BEivatel "drug via
Digitalmars-d-learn" <digitalmars-d-learn puremagic.com>:
using classes I can make an inherited class of templated class and avoid
too long mangled name:
```
class TemplatedClass(A, Very, Much, Args, Here) { ... }
class ShortenClass : TemplatedClass!(A,Very, Much, Args, Here) { ... };
```
Now ShortenClass has a nice mangling.
What can be done in case of struct?
Oct 10 2017
On 10/10/2017 04:30 AM, drug wrote:
using classes I can make an inherited class of templated class and avoid
too long mangled name:
```
class TemplatedClass(A, Very, Much, Args, Here) { ... }
class ShortenClass : TemplatedClass!(A,Very, Much, Args, Here) { ... };
```
Now ShortenClass has a nice mangling.
What can be done in case of struct?
I think an alias is more suitable here for both classes and structs:
alias ShortenClass = TemplatedClass!(int,bool, float, ubyte, string);
Ali
Oct 10 2017









Daniel Kozak <kozzi11 gmail.com> 