Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 22, 2021 at 11:44:51PM +, Rekel via Digitalmars-d-learn wrote: > On Thursday, 22 April 2021 at 23:41:33 UTC, H. S. Teoh wrote: > > On Thu, Apr 22, 2021 at 10:47:17PM +, Rekel via Digitalmars-d-learn > > wrote: > > > I'm not sure why this is happening, but after simplifying my

Re: String concatenation segmentation error

2021-04-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 23 April 2021 at 00:44:58 UTC, tcak wrote: As far as I see, it is not related to that array or indices at all. The question of where is to see if it was CTFE allocated or runtime allocated. I don't think it should make a difference here but idk. If there is no known situation

Re: String concatenation segmentation error

2021-04-22 Thread tcak via Digitalmars-d-learn
On Friday, 23 April 2021 at 00:30:02 UTC, Adam D. Ruppe wrote: On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote: "positions" array is defined as auto positions = new float[ 100 ]; So, I am 100% sure, it is not out of range. "ri*dim + 1" is not a big number at all. Oh and *where* is

Re: String concatenation segmentation error

2021-04-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote: "positions" array is defined as auto positions = new float[ 100 ]; So, I am 100% sure, it is not out of range. "ri*dim + 1" is not a big number at all. Oh and *where* is that positions variable defined?

Re: String concatenation segmentation error

2021-04-22 Thread Adam D. Ruppe via Digitalmars-d-learn
Are there any other threads in your program?

Re: String concatenation segmentation error

2021-04-22 Thread tcak via Digitalmars-d-learn
In other parts of the code, concatenation operations are all failing with same error. I need guidance to get out of this situation. My assumption was that as long as there is empty heap memory, concatenation operation would succeed always. But, it doesn't seem like so.

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-22 Thread Rekel via Digitalmars-d-learn
On Thursday, 22 April 2021 at 23:41:33 UTC, H. S. Teoh wrote: On Thu, Apr 22, 2021 at 10:47:17PM +, Rekel via Digitalmars-d-learn wrote: I'm not sure why this is happening, but after simplifying my code I traced it back to what the title may suggest. Keep in mind that CTFE does not

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 22, 2021 at 10:47:17PM +, Rekel via Digitalmars-d-learn wrote: > I'm not sure why this is happening, but after simplifying my code I > traced it back to what the title may suggest. Keep in mind that CTFE does not support reinterpretation via unions, i.e., reading values from a

CTFE Assignment to anonymous union shows unexpected behavior

2021-04-22 Thread Rekel via Digitalmars-d-learn
I'm not sure why this is happening, but after simplifying my code I traced it back to what the title may suggest. The original cause of my issues being summarized by debug print statements returning a union as: Mat([nanf, nanF, . . . .], [[1.0F, 0.0F, . . . .]) Even though the nanF should

String concatenation segmentation error

2021-04-22 Thread tcak via Digitalmars-d-learn
string fileContent = ""; ... writeln(ri, ": debug 1"); foreach(i; 0..dim) { if( i > 0 ){ fileContent ~= "\t"; } writeln(ri, ": debug 1.1: ", ri*dim + i, ": ", positions[ ri*dim + i ]); fileContent ~= to!string(positions[ ri*dim + i ]); writeln(ri, ": debug 1.2: ", ri*dim

Re: Voldemort type "this" pointer

2021-04-22 Thread realhet via Digitalmars-d-learn
On Wednesday, 21 April 2021 at 15:53:59 UTC, Ali Çehreli wrote: On 4/21/21 8:37 AM, realhet wrote: On Wednesday, 21 April 2021 at 10:47:08 UTC, Mike Parker wrote: On Wednesday, 21 April 2021 at 10:00:51 UTC, realhet wrote: It has access to the context of its enclosing scope (via an added