const and immutable values, D vs C++?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Dec 5 00:05:26 UTC 2019


On Wednesday, 4 December 2019 at 23:27:49 UTC, Steven 
Schveighoffer wrote:
> void main()
> {
>     foo!a(); // const(int)
>     foo!b(); // immutable(int)
>     foo!c(); // const(int)
> }

Ok, so one has to use a wrapper and then "catch" the result with 
auto?

auto x = foo!f();



More information about the Digitalmars-d-learn mailing list