Earlier quoted context omitted.
What do you mean? I'm pretty sure no two distinct floats compare as equal.
-0.0 and +0.0?
(This is a serious question I honestly don't know.)
41–50 of 102 posts
Earlier quoted context omitted.
What do you mean? I'm pretty sure no two distinct floats compare as equal.
-0.0 and +0.0?
(This is a serious question I honestly don't know.)
Earlier quoted context omitted.
-0.0 and +0.0?
Are those floats actually distinct? I mean you could represent 3.0 + 4.0 = 7.0 as well. Are "-0.0" and "0.0" actually different? (This is a serious question I honestly don't know.)
Another language-changing paradigm added to C++. I haven't even finished learning the old ones yet. Sometimes I think C++ would be better off if the committee stopped accepting proposals that add new features.
I think there's more to it (changing the language) than you are crediting it. First, you don't have to use the new features (though eventually you'll be reading the code of people who did, so this is only half-valuable). There is new c++11 code being written every day -- in volume (a hard to pin down amount) it's sadly more than 50%. The usage surveys don't really capture this clearly (and it's not clear they could).…
Another language-changing paradigm added to C++. I haven't even finished learning the old ones yet. Sometimes I think C++ would be better off if the committee stopped accepting proposals that add new features.
Scott Meyers thinks similarly, I think. https://www.youtube.com/watch?v=KAWA1DuvCnQ
The additions since he bowed out improve the experience of production coders.
Earlier quoted context omitted.
Are those floats actually distinct? I mean you could represent 3.0 + 4.0 = 7.0 as well. Are "-0.0" and "0.0" actually different? (This is a serious question I honestly don't know.)
They are distinct values but they compare equal. For almost all uses they are effectively equal, except where you are producing infinities.
Thanks for clearing that up!
Is it just me, or have C++ errors gotten a lot better? Below example from guide seems a lot more ergonomic than in years past. test.cpp: In instantiation of ‘T add(T, T) [with T = std::basic_string ]’: test.cpp:17:21: required from here test.cpp:11:22: error: static assertion failed 11 | static_assert(std::is_integral_v ); | ~~~~~^~~~~~~~~~~~~~~~ test.cpp:11:22: note: ‘std::is_integral_v >’ evaluates to false Build f…
clang kinda started the race
Clang concepts were implemented by one guy.
Another language-changing paradigm added to C++. I haven't even finished learning the old ones yet. Sometimes I think C++ would be better off if the committee stopped accepting proposals that add new features.
I guess this is somewhat besides the point but checking if something can be multiplied by -1 is not great as a definition of subtraction. You'll typically want to use the additive inverse directly. I mean sure you can extend any commutative group into a module over the integers but you probably don't want to make this a hard requirement just to have subtraction.
Earlier quoted context omitted.
I think you're trying to say you like C but dislike C++'s complexity. You will enjoy Go. Go can be understood as an improved, modernized C that doesn't abandon C's simplicity.
The "Go is like C" comparison never made any sense to me. Go has a sophisticated runtime with transparent N:M threading and built-in concurrency primitives, Interfaces, garbage collection and a large standard library. Go is only simple when compared to the other languages that sit in a similar space, like Java and C#.
Another language-changing paradigm added to C++. I haven't even finished learning the old ones yet. Sometimes I think C++ would be better off if the committee stopped accepting proposals that add new features.
I haven't used it much yet, but I would still say it is pretty good although far from a proper template type system.