21 reputation
2
bio website
location Sweden
age
visits member for 3 years
seen Dec 9 '13 at 19:24

Aug
17
awarded  Teacher
Aug
4
comment What does C++ do better than D?
In my experience C++ references can be null in optimized builds since no exception is thrown when dereferencing a null pointer and passing it on to the reference in those kind of builds.
Aug
3
comment What does C++ do better than D?
Okay, I removed ref from the example since it doesn't improve the situation for classes. I had it in there because you mentioned it in your first comment. I also added a note about structs. Personally I am fully aware of D classes being reference types and not being placed on the stack without using something like emplace. Sorry for being unclear, my first version of the answer did probably deserve a -1. Please tell me if I can do something more to clarify the situation.
Aug
3
revised What does C++ do better than D?
Added brief comment about using struct instead of class.
Aug
3
revised What does C++ do better than D?
added 232 characters in body
Aug
2
awarded  Editor
Aug
2
comment What does C++ do better than D?
I like the way returning references to local variables is prohibited in D, I was not aware of that until I read your comment. But you can still return a non-local null reference without thinking about it in a way where the C dereference operator will make you think.
Aug
2
revised What does C++ do better than D?
Added example code to better explain what I'm talking about.
Jul
31
answered What does C++ do better than D?