const Propagation

Julian Kranz via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 29 07:36:57 PST 2014


On Monday, 29 December 2014 at 15:25:13 UTC, Daniel Kozak wrote:
> On Monday, 29 December 2014 at 15:17:30 UTC, Julian Kranz wrote:
>> Thank you for your answers. All of your suggestions go into 
>> the right direction, however there's still one thing left that 
>> breakes it: the method itself (blah()) needs to be marked as 
>> const to be callable on a const object. Therefore, I need 
>> something like
>>
>> void blah(...)(...) if(this ia const object) const : nothing {
>> }
>>
>
> Did you try my solutions? It doesn`t need blah to be const

Uuuhm, you're right, it works :-D I don't completely understand 
why the compiler does not require the function to be sonst any 
longer...


More information about the Digitalmars-d mailing list