Re: how to shorten templates structs name?

2017-10-10 Thread Ali Çehreli via Digitalmars-d-learn

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



Re: how to shorten templates structs name?

2017-10-10 Thread Daniel Kozak via Digitalmars-d-learn
Use alias this

Dne 10. 10. 2017 1:30 odpoledne napsal uživatel "drug via
Digitalmars-d-learn" :

> 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?
>


how to shorten templates structs name?

2017-10-10 Thread drug via Digitalmars-d-learn
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?