On 1/8/19 3:12 PM, SrMordred wrote:
size_t[2] a;
size_t[2] b;
auto x = a[] & b[]; //array operation without destination memory
not allowed
size_t[2] y = a[] & b[]; // fine
Honestly, I wouldn't have expected either to work. My understanding was
that array operations require slicing on
size_t[2] a;
size_t[2] b;
auto x = a[] & b[]; //array operation without destination
memory not allowed
size_t[2] y = a[] & b[]; // fine
On Mon, Apr 02, 2018 at 10:26:32AM +, RazvanN via Digitalmars-d-learn wrote:
> Hi all,
>
> Let's say we have this code:
>
> struct B
> {
> int a;
> this(int a) immutable
> {
> this.a = 7;
> }
>
> this(int a)
> {
> this.a = 10;
> }
> }
>
> void
On Monday, 2 April 2018 at 11:41:55 UTC, Eduard Staniloiu wrote:
On Monday, 2 April 2018 at 10:26:32 UTC, RazvanN wrote:
[...]
The compiler does an implicit conversion from the type
`immutable B`
to the type `B`. It is able to do safely do so because `struct
B` has only
value types that
On Monday, 2 April 2018 at 10:26:32 UTC, RazvanN wrote:
Hi all,
Let's say we have this code:
struct B
{
int a;
this(int a) immutable
{
this.a = 7;
}
this(int a)
{
this.a = 10;
}
}
void main()
{
B a = immutable B(2);
writeln(a.a);
a.a =
Hi all,
Let's say we have this code:
struct B
{
int a;
this(int a) immutable
{
this.a = 7;
}
this(int a)
{
this.a = 10;
}
}
void main()
{
B a = immutable B(2);
writeln(a.a);
a.a = 4;
immutable B a2 = immutable B(3);