If you needed to rewrite the following C++ code in D, how would you do it?
struct A{
const S* _s;
B _b;
C _c;
mutable C _c1, _c2;
A(const B& b, const C& c, const S* s){ /*...*/ }
void compute(const R& r) const
{
//...
_c1 = ...
_c2 = ...
}
};
D doesn't have mutable
, and, based on my experience, it's rarely used in C++. But, assuming mutable
is used for the right reasons here, what are my options in D?