@gracicot@mastodon.social avatar

gracicot

@gracicot@mastodon.social

C++ programmer, He/Him. Making an engine and games for fun. I love posting horrible CMake code here

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

gracicot, to cpp
@gracicot@mastodon.social avatar

While designing an ADL based API, I got bitten by ADL and accidentally called a function from the std namespace. I think I'll switch to deducing this instead

sos, to cpp
@sos@mastodon.gamedev.place avatar

Just looked up how to do callbacks in C++ and YOU CAN'T (unless you write a bunch of templates and wrappers yourself).

When you pass a pointer to non-static member function, yopu need to handle the class pointer yourself. This is like the simplest thing, why can't C++ have that?

Love how the ISO standard website just tells you "Don't". What a joke.

#cpp #programming

gracicot,
@gracicot@mastodon.social avatar

@sos @morten_skaaning Just not exactly what you expect. Pointer to member (data or function) allows to put a member in a variable, in order to dynamically select a member on a given object. So you can dynamically put a member in a variable auto mptr = &type::member then given an object, access that member, replacing object.member with object.*mptr. It's just a way to deffer or select dynamically members at runtime.

gracicot,
@gracicot@mastodon.social avatar

@sos @morten_skaaning If you want to create a callback just out of a member function and this the STL actually got it for you, no need for templates:

auto callback = std::bind_front(&type::member_function, this);

It's a bit like javascript where you need to bind a class function with an instance to properly use it as callback.

gracicot,
@gracicot@mastodon.social avatar

@sos @morten_skaaning The other answer would be of course "just use a lambda" because they work for pretty much all cases, even for C functions that can get a void*

Patricia, to random
@Patricia@vivaldi.net avatar

I am never going to get the hang of mastodon “DMs”

gracicot,
@gracicot@mastodon.social avatar

@Serene117 @Patricia I had the same reaction

mattgodbolt, to random
@mattgodbolt@hachyderm.io avatar

Happy 12th Birthday to the funny little project that stole my name

gracicot,
@gracicot@mastodon.social avatar

@mattgodbolt your name is a verb too now. I godbolted code my code many times.

mcc, to random
@mcc@mastodon.social avatar

So I spent a big chunk of my life living next door to Louisiana (Houston) and now I live next door to Quebec (Toronto) and it just this moment occurred to me to check if Quebec has beignets. Like, I'd simply assumed if I ever went liking for beignets I'd find them. So I asked a Quebecoise friend, and

Okay, so they do have them, but—

Quebec beignets have holes???

My world is (topologically speaking) rocked

gracicot,
@gracicot@mastodon.social avatar

@mcc potato maple beignets are the best

gracicot, to random
@gracicot@mastodon.social avatar
gracicot,
@gracicot@mastodon.social avatar

I was flabbergasted. I didn't expect it to be so bright and so colorful. Truly a spectacle!

jakub_neruda, to cpp Czech

Funny. I removed all modules from my C++ codebase (roughly 10% of it) and I got about 10-16% shorter compilation times. Not to mention Intellisense no longer crashing all over the place.

I wonder if it ever be a worthwhile feature to use.

gracicot,
@gracicot@mastodon.social avatar

@jakub_neruda the feature is not ready for prime time. Don't use it if the bleeding crashing edge is not your thing.

For compilation speed, it depends how fine grained your modules are. The smaller your modules are, the longer the compile time. They are not meant to replace headers 1:1. A good example is the STL, where any other splitting than just import std was found to be slower.

gracicot, to cpp
@gracicot@mastodon.social avatar

Crashing MSVC is too mainstream. Cool kids crash clang

#cpp #cplusplus #clang

aks, to cpp
@aks@scalie.zone avatar

Ok folks.

Is using static always evil or is having something like game state (paused, running, in menu etc) inside a static variable ok?

Or do i have to pass it around everywhere?

gracicot,
@gracicot@mastodon.social avatar

@aks usually, you should use a static function scope variable to create a singleton. Then you do your stuff through it.

I usually avoid global mutable variables though, or singleton of any form.

gracicot, to random
@gracicot@mastodon.social avatar

I'm not made to deal with this bullshit...

Schlangenmensch, to cpp German

Does anybody know when it will be possible to mix #c++ named and classic with ?

gracicot, (edited )
@gracicot@mastodon.social avatar

@Schlangenmensch from what I understood, you can include then import, but not the other way around. Minus bugs of course

vitaut, to random
@vitaut@mastodon.social avatar

Wait, what? {fmt} and vulkan-hpp are the only two modularized projects? https://arewemodulesyet.org/

gracicot,
@gracicot@mastodon.social avatar

@vitaut no libraries got the clown emoji award yet?? Disappointed

gracicot, to random
@gracicot@mastodon.social avatar

It's happening soon. There's not a cloud in sight! #eclipse2024

gracicot,
@gracicot@mastodon.social avatar

Towards totality

gracicot,
@gracicot@mastodon.social avatar

I'm still shaking. It was just like seeing a new color for the first time. It's impossible to explain how this felt. I'm truly grateful for this experience.

Total solar eclipse

vitaut, to random
@vitaut@mastodon.social avatar

Module support in MSVC is a garbage fire https://github.com/fmtlib/fmt/issues/3921

gracicot,
@gracicot@mastodon.social avatar

@vitaut MSVC support is excellent, as long as you're only doing hello world, just like how they test before calling a feature "ready"

olafurw, to random
@olafurw@mastodon.social avatar

A formal specification for a C++ package and dependency manager has been published. This will be very interesting for the language going forwards.

See: https://isocpp.org/ for more info.

gracicot,
@gracicot@mastodon.social avatar

@olafurw why 😭

herzenschein, to random

Maybe my next tech goal should be to get a Raspberry Pi 3 or 4. Here in Brazil there's finally an official reseller that's not too expensive and actually has them in stock.

Like maybe in two or three months?

The 10+ year old computer I've been using as a music server is close to dying too, and a Raspberry Pi would be more power efficient.

Alternatively I could use it to play with embedded Qt and Yocto.

gracicot,
@gracicot@mastodon.social avatar

@herzenschein electronics in Brazil are just so hard to find. I was just looking for a pendrive with usb 3 support and we ended up in a super fancy specialized electronics store just to find it.

eniko, to random
@eniko@peoplemaking.games avatar

god its such a massive difference between my energy levels before i started taking vitamin D supplements and after. before it felt like i never had energy to do literally anything. now i can get through my day okay

gracicot,
@gracicot@mastodon.social avatar

@eniko oh interesting. It's been a while I have low energy and I don't get much sunlight these days. It could be that!

sehe, to random
@sehe@fosstodon.org avatar

Really warming up to NixOs by just enjoying seemless bleeding edge packages under Ubuntu using Home Manager.

People have been telling me for years. I should have tried harder before.

I'm still not convinced it's worth going cold-turkey since pure NixOs seems like an awful lot of reinventing the same old boring stuff in a new way (but for the last time?! famous promise). The mix is fantastic. Blows docker out of the water. Really nice for CI/QA

gracicot,
@gracicot@mastodon.social avatar

@sehe I'm still slowly getting used to flakes. One step at a time :P

shafik, to random
@shafik@hachyderm.io avatar

This one goes out to my WG21 peeps

gracicot,
@gracicot@mastodon.social avatar

@shafik Like, literally I read P3096 and told myself "omg, that paper is right in my expertise area, this is my chance! I have to get involved" So yeah... 😅

And I love Junji Ito's work, simply amazing stuff

Sdowney, to random
@Sdowney@mastodon.social avatar

Off to Tokyo for the C++ ISO meeting!

14 hours in a tiny box with a 24 inch monitor. It will be just like home.

gracicot, (edited )
@gracicot@mastodon.social avatar

@DanielaKEngert @Sdowney I haven't written or helped on a paper yet. I just gave my feedback on the SG7 mailing list, I thought it could be useful material for the author. If I ever help on the paper I guess that would probably be after the post Tokyo.

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