Const vs Non const method

Ola Fosheim Grøstad via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 7 10:17:18 PST 2016


On Monday, 7 March 2016 at 16:30:48 UTC, Namespace wrote:
> Thanks to the wildcard modifier inout. Is there any possible 
> way to do the same in C++?

In this specific case you could do it with a macro if you don't 
mind dirty macros, but you really should implement the const 
version explicitly or use a free function that cover both cases 
using templating.

If you are looking for information on C++ you probably should use 
stack overflow:

http://stackoverflow.com/questions/7792052/c-template-to-cover-const-and-non-const-method



More information about the Digitalmars-d-learn mailing list