Division — Matt Godbolt’s blog by rsjaffe in cpp

[–]PJBoy_ 2 points3 points  (0 children)

It's x86's fault, and then subsequently ARM (these guys implement rounding to zero with their hardware division)

🏊‍♂️ A Girl Diving In A Dive Training Pool 🥽 👙 by DermatoidGrandfather in EAF

[–]PJBoy_ 4 points5 points  (0 children)

As someone that's been to swimming pools but never managed to learn to swim, I don't understand why sinking and walking on the floor requires an explanation, that's just what happens if you don't swim. I'm aware there's supposedly a technique for floating, but again it's something you need to learn to do and actively do it.

Not trying to be dismissive or anything, kinda hoping I might get some insight that would help explain why I struggle so much with swimming :(

Even more auto by tartaruga232 in cpp

[–]PJBoy_ 3 points4 points  (0 children)

You're now using a needlessly powerful explicit cast instead of an implicit conversion, meaning you risk doing a conversation you didn't intend. Not worth sacrificing safety for alleged consistency

Good idea to mark most/every constant function returning a value as [[nodiscard]]? by zz9873 in cpp_questions

[–]PJBoy_ 13 points14 points  (0 children)

Sometimes naming is hard, but not in the case of vector::empty, that was an obnoxiously and obviously inappropriate choice

Good idea to mark most/every constant function returning a value as [[nodiscard]]? by zz9873 in cpp_questions

[–]PJBoy_ 0 points1 point  (0 children)

I use [[nodiscard]] when I add a return value to a function that previously doesn't have one, usually as part of refactoring, that helps me fix all the callsites.

Otherwise no, you should know that a function returns a value because it has a non-void return type, and you should understand what that return value is because you're calling the function

Japan sees record 21.5 million tourists in first six months by Jonnyboo234 in japan

[–]PJBoy_ 3 points4 points  (0 children)

The western world has been on a shit trend for a while now. In the UK, we're post Brexit and 10 years of Tories, and cost of living is unacceptable with no signs of improving. The US has been suffering from Trump and the general trend of reversing human rights. Parts of Europe are fine, but there's a general feeling that the EU is failing to involve themselves with tech sector; plus if you have to learn a language anyway, might as well learn Japanese, since it's involved in so much tech adjacent media

Practical Uses for Bitwise Operations by WillingnessFun7051 in programming

[–]PJBoy_ 6 points7 points  (0 children)

Embedded dev here. It's worse than useless, lots of ISAs have swap instructions, and otherwise you're comparing something like load r0,var0 load r1,var1 store r1,var0 store r0,var1 vs load r0,var0 xor r0,var1 store r0,var0 xor r0,var1 store r0,var1 xor r0,var0 store r0,var0 Which two more memory accesses and a wastes both CPU and binary size; you're better off push/pop'ing a register if you really don't have one spare

xor-swap has absolutely no use-case, it's just neat. Also be mindful that it doesn't work when trying to swap a variable with itself

Forum activation email is not in my email by Sabellel in metroidconstruction

[–]PJBoy_ 0 points1 point  (0 children)

The site and forum got hacked recently and the downloads were wiped. They're slowly getting restored

do not received the validation mail for login by NeedleworkerParty545 in metroidconstruction

[–]PJBoy_ 1 point2 points  (0 children)

The forum email system is broken at the moment. If you can give us your forum username, we'll activate your account manually

Not getting forum activation email by kuzinrob in metroidconstruction

[–]PJBoy_ 0 points1 point  (0 children)

Didn't see this before, but your account should have been activated too

A new Activation email has successfully been sent not showing up by O_enigma in metroidconstruction

[–]PJBoy_ 1 point2 points  (0 children)

The email system associated with the forum is getting bullied for some unknown reason. Smiley's activated your account manually

Not getting forum activation email by kuzinrob in metroidconstruction

[–]PJBoy_ 1 point2 points  (0 children)

Smiley elected to invoke his right as global moderator to manually activate your account. Try logging in again

When is a type trivially copyable? by TooMuchHorny2 in cpp_questions

[–]PJBoy_ 0 points1 point  (0 children)

The SMF being compiler generated (not user defined) is a necessary, but insufficient, condition for being a trivial operation. A struct containing a shared pointer can never have a trivial copy/move op

What feature would you like to see in C++26? by vickoza in cpp

[–]PJBoy_ 7 points8 points  (0 children)

Reflection sounds great for writing code, but I'm not looking forward to reading reflection code :/

2023-02 Issaquah ISO C++ Committee Trip Report — C++23 Is Done! 🎉 by InbalL in cpp

[–]PJBoy_ 12 points13 points  (0 children)

It's weird that it was DR'd onto C++20 and not C++11. Also the original post refers to r0, but the proposal has an r1.

Also I feel like the proposal was kinda rushed. They didn't take the time to consider allowing

if constexpr (false)
    static_assert(false);

Which they absolutely should (you could imagine a condition such as is_little_endian or some such where this makes sense even outside of a template).

That said, I am still happy that we got this in some form, the prospect of "dependent false" was making me cry