Printing shortest decimal form of floating point number with Mir

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jan 5 23:14:48 UTC 2021


On Tuesday, 5 January 2021 at 21:46:34 UTC, Ola Fosheim Grøstad 
wrote:
> It is very useful to create a simple alias from a complex type 
> for export from a type library, then it breaks when people use 
> that type library to write templated functions.
>
> People do this all the time in C++.

Example:

// library code

struct _config(T){}
struct _matrix(T,C){}

alias matrix(T) = _matrix!(T,_config!T);


// application code

void f(T)(matrix!T m){}

void main()
{
     f(matrix!float());
     f(matrix!double());
}




More information about the Digitalmars-d-announce mailing list