cpp

jackwilliambell,
@jackwilliambell@rustedneuron.com avatar
professorhank,
@professorhank@sfba.social avatar

Come check out my latest C++ video. Leave a note in the YouTube comments letting me know how I did.

https://youtu.be/dArZpIrMftY

smurthys,
@smurthys@hachyderm.io avatar

Y'all leave reminders like this too in your C++ code at end of day? 🤔

static_assert(false, "Complete this first. Don't get distracted");

gdinwiddie,
@gdinwiddie@mastodon.social avatar

@smurthys
I prefer to leave a failing test of the next thing I plan to implement.

DanielaKEngert,
@DanielaKEngert@hachyderm.io avatar

Dear Fediverse,

in case you care, I'd love if you'd vote for this issue of mine:

https://developercommunity.visualstudio.com/t/Cconstant-evaluationModules-Cons/10661450

Serious constant evaluation and C++ modules seem to live on different planets.

Thanks, much appreciated! 🩷

darkcisum,
@darkcisum@swiss.social avatar

Cross-platform, cross-language development is quite tedious... 🙃

You need to wait for builds to finish, then test on three different OS with different ways to load things.

At least with a Windows machine, you get a Linux environment via WSL2 for free, although it doesn't launch via dotnet run.
And finally you also need access to macOS somehow.

But it's quite satisfying seeing the library build automatically on all the different configurations: https://github.com/SFML/CSFML/pull/249

#c

jbzfn,
@jbzfn@mastodon.social avatar

🧑‍💻 Butano: Modern C++ high level GBA engine
— GValiente

https://github.com/GValiente/butano

sinbad,
@sinbad@mastodon.gamedev.place avatar

Ooh, I do like the new "Sticky Lines" feature in Rider 2024

derAnhaltiner,
@derAnhaltiner@troet.cafe avatar

@sinbad yeah. That's pretty cool. 👍🏼

julienbarnoin,
@julienbarnoin@mastodon.gamedev.place avatar

All this time I've been using the return value of snprintf as the number of characters actually written, when it's in fact the number of characters that would be written if the max size passed in were large enough.

In fact: "If the resulting string would be longer than n-1 characters, the remaining characters are discarded and not stored, but counted for the value returned by the function."

BRB, got a bunch of files to go back over... 😓

#c

gfxstrand,
@gfxstrand@mastodon.gamedev.place avatar

@julienbarnoin Yeah, IIRC Windows just returns -1 if there's an overflow.

julienbarnoin,
@julienbarnoin@mastodon.gamedev.place avatar

@gfxstrand Good to know, will definitely be checking that.
Of course to be sure I should check the behaviour on Windows 11, Windows 10... Windows 8.1, Windows 8... Windows XP, 2000... Windows Me, no just kidding on that last one.

cdrmack,
@cdrmack@fosstodon.org avatar

After 10 years of commercial experience in I think I’m ready for a new chapter. I have played around with and but most job offers that I see are for people with at least X years of commercial experience in this exact languages. Do you have any hints how to approach this? I would think that my previous experience as a engineer would matter. Especially since I do not expect to move to another senior role, I’m checking junior positions too.

deshipu,
@deshipu@fosstodon.org avatar

@cdrmack ignore the requirements, they are copy-pasted by people who have no idea what they are writing about

jakub_neruda, Czech
@jakub_neruda@techhub.social avatar

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.

aks,
@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.

aeva,
@aeva@mastodon.gamedev.place avatar

@aks static variables are fine. if it wasn't good, bjarne wouldn't have put it in c++

smurthys,
@smurthys@hachyderm.io avatar

I spent ~hour yesterday fighting an issue with my C++ code, only to later figure out it's a possible GCC bug, because Clang accepts the same code.

The issue is that GCC does not permit a constrained type parameter in a template template parameter of an aliased template. See the simplified code with the issue.

A cursory search of GCC Bugzilla does not readily show any related bug. I'll look carefully but lemme know if this is a known bug (probably is). 🙏🏽

https://sigcpp.godbolt.org/z/bGTnM3v1q

#cpp #gcc #bug

cpponline,
@cpponline@mastodon.social avatar

What’s New in Compiler Explorer? 2024 Update – by @mattgodbolt – C++Online 2024

https://www.youtube.com/watch?v=28Gp3TTQYp0

Schlangenmensch, German
@Schlangenmensch@mastodon.social avatar

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

Schlangenmensch,
@Schlangenmensch@mastodon.social avatar

@gracicot I can't get it to work. I have a source file including iostream and importing a module. The module imports Std and uses some stl stuff, e.g. a unique_ptr. And voila, I get redifinition errors in <memory>.

Without the include of <iostream> everything works as expected. And it doesn't matter If include or import comes first.

molecularmusing,
@molecularmusing@mastodon.gamedev.place avatar

Live++ 2.5.0 OUT NOW for Windows, Xbox Series X|S, and PlayStation®5!
https://liveplusplus.tech/

This is the only solution that supports simultaneous hot-reload for C++ applications across multiple platforms and processes, both locally and over the network.
https://www.youtube.com/watch?v=ewbkdxskl7I

#cpp #gamedev

kdab,
@kdab@techhub.social avatar

With regular uploads on various programming topics, there's always something new to learn on our YouTube channel KDAB TV. Subscribe now and elevate your programming skills with us: https://www.youtube.com/@KDABtv

daridrea,
@daridrea@graphics.social avatar

The Real C++ Killers (Not You, Rust) by Oleksandr Kaleniuk https://wordsandbuttons.online/the_real_cpp_killers.html

SonnyBonds,
@SonnyBonds@mastodon.gamedev.place avatar

Any dyld/linkage experts out there that can make a wild guess as to why one plugin (ours) in loaded in a host process would call straight into another (someone else's)? On macOS.

I think our plugin is calling std::generic_category() but ends up in another module instead of libc++. (Can't reproduce it locally so my context is limited.)

Address in target module is always the same relative its base, which makes me think it's somewhat deliberate and not a jump to garbage address.

#cpp

CoBC, French

Si vous connaissez quelqu'un qui connaît quelqu'un qui a son oncle qui connaît quelqu'un dont le voisin recherche quelqu'un pour un poste de développeur soit web soit c++ (+ Qt éventuellement) je suis preneur. Boosts appréciés
#C++ #C

meetingcpp, German
@meetingcpp@mastodon.online avatar

Book of the Day: Secure Coding in C and C++ by Robert C. Seacord
https://meetingcpp.com/mcpp/books/book.php?hash=46e52215a197434cc983fa63521e1749bb7c1509

ctaylor, (edited )
@ctaylor@mastodon.content.town avatar
meetingcpp, German
@meetingcpp@mastodon.online avatar

Per-Magnus Holtmo: Using gRPC to fight Mordor
https://www.youtube.com/watch?v=lesTvLzTrmg

AminiAllight,
@AminiAllight@mastodon.gamedev.place avatar

I've released a clang tidy for C/C++ that finds division by non-constant values to help you search for possible division-by-zero in your codebase!
This is mostly a tool I built for myself to help with LMOD development but others might find it useful too
https://github.com/amini-allight/clang-tidy-division-by-non-constant

alvinashcraft,
@alvinashcraft@hachyderm.io avatar
fell,
@fell@ma.fellr.net avatar

C++ compiler be like:

error LNK2001: unresolved external symbol "public: static class std::unordered_map&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;,unsigned int,struct std::hash&lt;class std::basic_string&lt;char,struct std::char_traits&lt;cha r&gt;,class std::allocator&lt;char&gt; &gt; &gt;,struct std::equal_to&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;,class std::allocator&lt;struct std::pair&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const ,unsigned int&gt; &gt; &gt; TextureStore::texture_cache" (?texture_cache@TextureStore@@2V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IU?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits @D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@std@@@2@@std@@A)

And expect me to casually read that and go "Ah, I see".

CodingThunder,
@CodingThunder@mastodon.social avatar

@fell once you get used to it, you can go through it in like 5 sec and figure out what's wrong

fell,
@fell@ma.fellr.net avatar

@CodingThunder I found the issue immediately. But I won't ever get used to this. I've been a full-time C++ programmer for six years now. I will never get used to this.

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