Which of these two in #AlmostAlwaysAuto code? Is there a better variant?
#almostalwaysauto #cxx #programming #codestyle
Getting bit by this issue is a #cmake rite of passage https://gitlab.kitware.com/cmake/cmake/-/issues/19063 #cpp #cxx
Does anyone have experience with using #cpp libraries in #rust codebases with the #cxx crate?
I'm a total noob in C++ and the best I could come up with is this: https://github.com/beeb/test-occ-bindings
Trying to use #occt to convert a #STEP file into #STL
Any help would be greatly appreciated!
#cpp #rust #cxx #occt #step #STL #rustlang
C: int main ()
C++ int main (int argc, char*[] argv)
C+++: [[nodiscard]] int main (int argc, char*[] argv)
C++++: auto main = [[nodiscard]] [&] (int argc, PointerWrapper<PointerWrapper<char>> argv) noexcept(noexcept( body_of_program )) -> int { body_of_program; };
(yes it's missing whatever C++26/2z is going to add as a raw wrapper for raw pointers, since for some reason ""““"modern""””"" C++ is afraid of everything native. Might as well replace 'int' for some sort of SystemTypeIntegerBytes<32> or somesuch)
Ever wanted to #switch on a #QMetaType, or just a random, non-literal constexpr char pointer, aka. #string? Search no more:
https://gist.github.com/hasselmm/9cc5fb4404b52d28560b86cb468ca707
#switch #qmetatype #string #cxx #cpp #moderncpp #qt #programming #metaprogramming
Excellent insights gained from AMA with Prof Bjarne Stroustrup. He discusses about his new book as well.
https://www.youtube.com/watch?v=KwLmsFgogN0
#cc
#isocpp
#cpp
#cplusplus
#cxx
#programming
#SoftwareHub
#Cairo
#Ankara
#Riyadh
#Maghreb
#Mashreq
#Community
#Learning
#cc #isocpp #cpp #cplusplus #cxx #programming #SoftwareHub #cairo #ankara #riyadh #maghreb #mashreq #community #learning
Since I fell ill yesterday I’ve spent my time mostly in bed, binge watching the ‘Back to Basics’ videos of last year’s #CppCon.
https://youtube.com/@CppCon/videos
Each talk is about an hour long, but most can be watched at increased playback speed.
@philcrissman After learning a few languages I learned to only dig into the ones that had something specific that I liked or wanted to learn more about. Not collecing them like talispeople. For example #rust is really intereting to me as an old #c and #c++ dev because of how they came up with abstractions that reflected or enforced good memory management habits you need in older languages such as #c or #cxx
I started the day coding, went for a bit of inline skating, and am now returning to coding.
Feels a bit like a day out of Hackers (the 1995 movie), but (unfortunately?) with less hilarious nonsense.
#hackThePlanet #inlineSkating #skating #hacking #softwareDevelopment #cpp #cxx
#hacktheplanet #InlineSkating #skating #hacking #softwaredevelopment #cpp #cxx
A brainstormy conversation at work the other day resulted in me believing
a) a borrow checker in C++ would benefit from a MIR
b) a MIR for C++ is possible and worth the effort to save time writing dataflow analysis, instead of dealing with the enormous complexity of C++ on every line of your tool.
This built on my previous underlying belief that a borrow checker is the way to save C++ codebases by giving them a clear path of improvement to safety.
So we have begun to make this happen. #cxx
I managed to overcome yesterday’s frustration and had a close look at this article:
Practical Makefiles, by example
http://nuclear.mutantstargoat.com/articles/make/
With additional documentation from https://makefiletutorial.com I managed to compose a decent, efficient Makefile.
I just wish it could be easier.
#cpp #cxx #c #softwaredevelopment #make #compile #build #programming
#cpp #cxx #c #softwaredevelopment #Make #compile #build #programming
The one thing that really bothers me about C++ is the build process.
I wasted so much time tinkering with my Makefile only to abandon everything and go with the simplest, least efficient method.
#cpp #cxx #softwaredevelopment #programming
@RecursiveNeuron I wonder whether the Go compiler just optimises something away, because you're not doing something with the count variable.
I tried this in C/C++:
for (int i = 0; i < 1000000000; i++) {}
It gives different results (0.001s vs. 1.595s) for me, when I compile it with vs. without -O3 in GCC respectively, and ~0.22s in Go consistently. Don't know how to switch optimisations on/off in Go. Have to check that.
Writing a small test game to figure out SFML + Blend2D (I'll probably give away the source to it).
One of the first things that goes into any of my projects is making it easy to write and run unit tests. Old me can't be bothered to build the game from untested code pieces only to then have to debug through every step of the way and still miss edge cases :)
#unittesting #cxx #programming
Question to #rustlang #cxx people: I am using the #cxx crate to generate bindings to call Rust from C++.
I have a Rust function returning an opaque Box<MyType> which I want to hold as a class member in the C++ side.
The thing is the cxx generated Box<MyType> isn't default-constructible, so I used a smart_ptr<Box<MyType>>...
Is there a Right(TM) way of doing this?
I have posted one new article on using #cpp library from #rust using #cxx crate - https://pnkv.dev/post/2022/11/19/using-cpp-from-rust-depthai-core-rgb-camera-example/ #depthai core example of using RGB stream encoded in H265
@fribbledom It's annoyingly infuriating in the C++ #CXX #CppLang community, where anytime someone wants to raise a proposal for something, the vermin comes out of the woodworks screeching "it should be like in Rust!" or "C/C++ can't be fixed because it's not Rust!".
Thank you https://github.com/dtolnay/cxx, I don't have to extend my old work in #cxx anymore. Back to #rust and #cargo🤟