Re: Struct member functions emit unnecessary call to _d_assert_msg

2014-01-24 Thread Daniel Murphy
"Mike" wrote in message news:lxusmgyievzioacmg...@forum.dlang.org... What bothers me is the branch at . It looks like it's checking the struct instance to see if it is null. Is it even possible for it to be null? Can this be improved? It's checking if the 'this' pointer is null. Syntactical

Struct member functions emit unnecessary call to _d_assert_msg

2014-01-24 Thread Mike
I'm beginning to implement structs in my ARM Cortex-M runtime, and I ran across something interesting today. Consider this struct: struct TestStruct { uint TestVar; void Print() { trace.WriteLine("TestStruct.Print"); } } And a function that uses that struct: void MyFunc