@foonathan@fosstodon.org
@foonathan@fosstodon.org avatar

foonathan

@foonathan@fosstodon.org

C++, compilers, and programming languages. Library developer @ think-cell, assistant chair for std::ranges @ C++ standardization committee.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

cschreib, to random

@foonathan (first Mastodon message, sorry if I screw this up!) Interesting pitfall to know about! About the last point on the long function in a header, you can always solve this by moving the code into another non template and private function, and just call that function in the template conversion operator, no?

foonathan,
@foonathan@fosstodon.org avatar

@cschreib Yes.

foonathan, to cpp
@foonathan@fosstodon.org avatar

I've written a new blog post: Constrain your user-defined conversions

https://www.think-cell.com/en/career/devblog/constrain-your-user-defined-conversions

olafurw, to random
@olafurw@mastodon.social avatar

"Vietnam bans Barbie movie over disputed South China Sea map"

My question is, why is there even a map of the South China Sea in the Barbie movie?

foonathan,
@foonathan@fosstodon.org avatar
olafurw, to random
@olafurw@mastodon.social avatar

Didn't know you could obliterate the community sentiment of a programming language so quickly.

But if it makes the Nim guy happy, then more power to him.

foonathan,
@foonathan@fosstodon.org avatar

@olafurw Actually not the first time. There's a rant by the creator about pronouns somewhere on the D forum.

foonathan, to random
@foonathan@fosstodon.org avatar

I've actively tried to use the official reddit app since that's the only option left after tomorrow, and it's so awful.

The home feed changes every time you refresh it, showing fewer and fewer posts until it runs out. How can they mess this up? How am I supposed to revisit posts with interesting discussion?

HOW DID THEY MESS THIS UP?! REDDITS HOME FEED IS THE MAIN FEATURE OF THE SITE!

lesley, to random
@lesley@mastodon.gamedev.place avatar

It's been 0 days since I got tricked by trailing commas in JSON. And the parser error was 100+ lines away from the trailing comma 🙁

foonathan,
@foonathan@fosstodon.org avatar

@lesley Every JSON parser should be written to support trailing commas, and just warn when it sees them.

bjorn_fahller, to random

I am confused about the interaction between C++ <=> and ==.

If I get the operators via CRTP from a mixin, then operator== is needed for equality comparison, but if I implement operator<=> directly in the type, operator== is not necessary.

Why is that?

I do note that the three major compilers behave the same way, so I assume it's not a compiler bug but rather intended behaviour.

https://godbolt.org/z/1ss48T786

foonathan,
@foonathan@fosstodon.org avatar

@bjorn_fahller The compiler never calls <=> for ==. However, if you default <=>, it will also default ==.

foonathan,
@foonathan@fosstodon.org avatar

@bjorn_fahller There used to be a rewrite of == that calls <=>, it got removed for performance reasons. The default behavior then got added in for convenience and to keep the original "only one operator is needed" pitch of the feature.

chandlerc, to random
@chandlerc@hachyderm.io avatar

So, in non-tech news...

My partner and I are embarking on an exciting new adventure: building our dream home!

But by "dream home", it's looking like it will be more of a mountain-fortress-of-solitude... although we do hope to still entertain & throw parties there from time to time. =]

Current phase: find and acquire a site/lot. The region we're interested in is the Santa Cruz mountains where I can still commute to work.

We've struggling to evaluate two candidate sites...

1/

foonathan,
@foonathan@fosstodon.org avatar

@chandlerc Sounds like two can be fixed with more money, but you can't buy a better view.

foonathan,
@foonathan@fosstodon.org avatar

@chandlerc And there is no chance the city/county/whatever will improve the street infrastructure at some point?

foonathan,
@foonathan@fosstodon.org avatar

@chandlerc Average European mountain road, don't see the problem :D

foonathan,
@foonathan@fosstodon.org avatar

@chandlerc Easy fix then: have your guests park somewhere downhill, drive personally down to pick them up - you enjoy the road, they don't have to drive it, and you don't need parking...

foonathan, to cpp
@foonathan@fosstodon.org avatar

I've written a trip report of the ISO C++ meeting in Varna last week:

https://www.think-cell.com/en/career/devblog/trip-report-summer-iso-cpp-meeting-in-varna-bulgaria

foonathan, to random
@foonathan@fosstodon.org avatar

Reading @graydon's post about his Rust vision is interesting.

https://graydon2.dreamwidth.org/307291.html

The part of "no & in structs" is being tried out in Val: https://www.val-lang.dev/

foonathan, to random
@foonathan@fosstodon.org avatar

What's a good name for a hash table that supports only insert and lookup but no erase?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • InstantRegret
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • modclub
  • Youngstown
  • ngwrru68w68
  • slotface
  • osvaldo12
  • kavyap
  • DreamBathrooms
  • Leos
  • thenastyranch
  • everett
  • cubers
  • cisconetworking
  • normalnudes
  • Durango
  • anitta
  • khanakhh
  • tacticalgear
  • tester
  • provamag3
  • megavids
  • lostlight
  • All magazines