On Wednesday, 24 June 2015 at 19:45:12 UTC, Adam D. Ruppe wrote:
On Wednesday, 24 June 2015 at 19:41:54 UTC, Freddy wrote:
I was surprised when this happened, is it a bug or a feature?
Feature, overwriting const or immutable data would violate the
promise that it never changes. Saving a struc
On Wednesday, 24 June 2015 at 19:41:54 UTC, Freddy wrote:
I was surprised when this happened, is it a bug or a feature?
Feature, overwriting const or immutable data would violate the
promise that it never changes. Saving a struct over another
struct is just another way of overwriting the data
I was surprised when this happened, is it a bug or a feature?
---
struct A
{
const int var;
}
int test()
{
auto b = A(5);
auto c = A(7);
pragma(msg, typeof(b)); //A
pragma(msg, typeof(c)); //A
auto d = b; //compiles
b = c; //doesn't compile
}
---
$ rdmd -main -unittes