Eric Bouchard

@ocitrev
22 Followers
101 Following
16 Posts
How do you pronounce it?
(pls boost for reach)
“GIF”
48.7%
‘’GIF’’
51.3%
Poll ended at .

Just realised that on Mastodon, boosting *is* the algorithm.

There's no code trying to cleverly show me stuff it reckons I'd be into, based on what my contacts are into, instead my contacts are saying "I like this, I bet my contacts would like it too" and that is way smarter than any algorithm.

Thank you, boosters!

The more you understand computers, the more you value systems without them.

The typical use case for the [[nodiscard]] attribute is marking functions whose return value shall not be ignored.

However, we can also apply the [[nodiscard]] attribute to constructors and even entire types.

At a minimum, constructors that acquire a resource and types that represent error states should be marked with [[nodiscard]].

Compiler Explorer link: https://compiler-explorer.com/z/KGracjxv7

#cpp #cplusplus #coding #programming #dailybiteofcpp

Compiler Explorer - C++

void acquire_resource() {} void release_resource() {} struct ResourceHandle { // Nodiscard constructor [[nodiscard]] ResourceHandle() { acquire_resource(); }; ~ResourceHandle() { release_resource(); } }; // Nodiscard type struct [[nodiscard]] Error {}; // nodiscard not needed, since Error is a nodiscard type Error function() { return {}; } int main() { // warning: ignoring return value // of 'ResourceHandle::ResourceHandle()', // declared with attribute 'nodiscard' ResourceHandle{}; // resource acquired and immediately released // warning: ignoring returned value of type 'Error', // declared with attribute 'nodiscard' function(); // ignoring Error }

I put together a meme
@olafurw @vitaut idspispopd

If someone gave you a music CD, do you have anything to listen to it on (not necessarily including ripping it)?

[Apparently "not necessarily" means different things to folks. I mean: devices capable of ripping but also devices not capable of it. Can you listen to a music CD?]

Please boost to reach a wide audience.

[Poll Over.]

Yes
81.5%
No
18.5%
Poll ended at .
@malwareminigun I thought this was PowerShell. I saw a .ps1 file in there.
@malwareminigun either get rid of parenthesis or add another $ inside the parenthesis, before the variable name.
@gkemp Looks like you are doing a greater than comparison `>` instead of a bitwise right shift `>>`