Re: D has the same memory model as C++

2021-08-11 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 19:38:38 UTC, Tejas wrote: On Wednesday, 11 August 2021 at 19:27:34 UTC, Ali Çehreli wrote: On 8/11/21 12:19 PM, Tejas wrote: Atleast leave some pointers on where to start :( I DuckDuckGo'ed it for you. :)

Re: D has the same memory model as C++

2021-08-11 Thread Tejas via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 19:27:34 UTC, Ali Çehreli wrote: On 8/11/21 12:19 PM, Tejas wrote: Atleast leave some pointers on where to start :( I DuckDuckGo'ed it for you. :) https://en.cppreference.com/w/cpp/language/memory_model Then looked it up at Wikipedia too:

Re: D has the same memory model as C++

2021-08-11 Thread Ali Çehreli via Digitalmars-d-learn
On 8/11/21 12:19 PM, Tejas wrote: Atleast leave some pointers on where to start :( I DuckDuckGo'ed it for you. :) https://en.cppreference.com/w/cpp/language/memory_model Then looked it up at Wikipedia too: https://en.wikipedia.org/wiki/Memory_model_(programming) Ali

Re: D has the same memory model as C++

2021-08-11 Thread Tejas via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 19:04:50 UTC, Ali Çehreli wrote: This is an interesting thread but "memory model" does not cover or mean all of the points discussed here. I can't define it precisely, so I'm leaving it to interested parties to search for themselves. :) Ali A little bit of

Re: D has the same memory model as C++

2021-08-11 Thread Ali Çehreli via Digitalmars-d-learn
This is an interesting thread but "memory model" does not cover or mean all of the points discussed here. I can't define it precisely, so I'm leaving it to interested parties to search for themselves. :) Ali

Re: D has the same memory model as C++

2021-08-11 Thread Bastiaan Veelo via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 05:33:06 UTC, Tejas wrote: On Tuesday, 10 August 2021 at 21:19:39 UTC, Bastiaan Veelo wrote: On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote: Basically, what are the subtle gotcha's in the differences between C++ and D code that looks similar The only

Re: D has the same memory model as C++

2021-08-10 Thread Tejas via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 21:19:39 UTC, Bastiaan Veelo wrote: On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote: Basically, what are the subtle gotcha's in the differences between C++ and D code that looks similar The only gotcha that comes to my mind is that `private` means

Re: D has the same memory model as C++

2021-08-10 Thread Bastiaan Veelo via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 18:13:17 UTC, Tejas wrote: On Tuesday, 10 August 2021 at 18:07:35 UTC, Bastiaan Veelo wrote: On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote: there's casting away const, a clearly seperate language feature which has no equivalent in D; You *can* cast

Re: D has the same memory model as C++

2021-08-10 Thread Bastiaan Veelo via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote: Basically, what are the subtle gotcha's in the differences between C++ and D code that looks similar The only gotcha that comes to my mind is that `private` means private to the module in D, not private to the aggregate. — Bastiaan.

Re: D has the same memory model as C++

2021-08-10 Thread Tejas via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 18:07:35 UTC, Bastiaan Veelo wrote: On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote: there's casting away const, a clearly seperate language feature which has no equivalent in D; You *can* cast away `const` in D: https://run.dlang.io/is/sWa5Mf —

Re: D has the same memory model as C++

2021-08-10 Thread Bastiaan Veelo via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote: there's casting away const, a clearly seperate language feature which has no equivalent in D; You *can* cast away `const` in D: https://run.dlang.io/is/sWa5Mf — Bastiaan.

Re: D has the same memory model as C++

2021-08-10 Thread Tejas via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 13:18:24 UTC, Paul Backus wrote: On Tuesday, 10 August 2021 at 11:05:53 UTC, Tejas wrote: Also, I have read here a principle that **If it looks like C, it behaves like C** How true is that for C++? Does code that look like C++(minus obvious syntax differences)

Re: D has the same memory model as C++

2021-08-10 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 11:05:53 UTC, Tejas wrote: Also, I have read here a principle that **If it looks like C, it behaves like C** How true is that for C++? Does code that look like C++(minus obvious syntax differences) behave like C++? No. D and C++ have different semantics for