It's immutable in both cases. You can use substitution for pure functions. auto a = add(1)(2); means that a is and will forever be the same thing as add(1)(2). You can substitute one with the other in any place. a == add(1)(2) == 3, a(3) == add(1)(2)(3).
If you get the errors of compile like "main.cpp:57:40: error: call to non-static member function without an object argument"
Do the method 'generateColor()' as static. It helped for me
have you tried to make the dunction a static one? ;)
I did it, It was really hard ))
This comment is hidden because it contains spoiler information about the solution
It's immutable in both cases. You can use substitution for pure functions.
auto a = add(1)(2);
means thata
is and will forever be the same thing asadd(1)(2)
. You can substitute one with the other in any place.a == add(1)(2) == 3
,a(3) == add(1)(2)(3)
.This comment is hidden because it contains spoiler information about the solution
a(3)
should be6
, buta
is still the value ofadd(1)(2)
and should be3
. It doesn't have any mutable state.This comment is hidden because it contains spoiler information about the solution
If you get the errors of compile like "main.cpp:57:40: error: call to non-static member function without an object argument"
Do the method 'generateColor()' as static. It helped for me
Just wow..