== Quote from Sean Eskapp (eatingstap...@gmail.com)'s article > Why doesn't this code work? > struct Bar > { > int* x; > } > void foo(Bar a) {} > void main() > { > const a = Bar(); > foo(a); > } > But replacing int* with some other type works fine? Even if a write a postblit > function for Bar, it still fails to compile.
Nevermind, I realized it's because constness is transitive in pointers. A const struct with a pointer member has a const pointer member, and those can't be implicitly cast to non-const pointer members.