3 ms·
I haven't written any C++ in a while, but isn't that how const methods work? One would think there might be a similar concept of a const lambda.
by nitrogen 11y ago
I haven't written any C++ in a while, but isn't that how const methods work? One would think there might be a similar concept of a const lambda.
- hellofunk 11y agoYou are talking about object methods, in which const has meaning limited to the object's data, and nothing else -- you can still do side-effects. I'm talking about also anonymous lambdas (modern c++ feature) and non-object functions. There is no way to say in C++ (or even a more functional language like Clojure) if a function has side-effects or not.