🍌 C++ Feed
306 subscribers
218 photos
12.7K links
Агрегатор всего подряд про C++.

Для связи: @smertig

Powered by https://github.com/Smertig/banana
Download Telegram
C++
std::thread performs like sh*t?

So i am working on a renderer, which works like a charm single-threaded. Getting about 100 fps. Now, my multithreaded render-loop looks like this: workerThreads.push_back(std::thread([](){})); for (std::size_t i = 0; i < workerThreads.size(); i++) workerThreads[i].join(); Your eyes are working just fine. A single thread, that does absolutely nothing. Doesn't render a single pixel. However, this code runs at fucking 15 fps now. Without doing anything. ​ If i comment out the last thread, i get back to 115fps. So somehow a single std::thread doing absolutely nothing takes 66 milliseconds!! Commenting out the join-part does absolutely nothing performance-wise ​ Am i just retarded or is this some sort of bug? submitted by /u/Dummerchen19...

Read full post
C++
how's circular reference handled in modules?

I haven't used modules because gcc doesn't currently support it, I'm however curious how's something like the following handled between modules? // A.hxx auto func(auto, auto); struct TypeA { auto f(); auto g(auto p) { return func(this, p); } }; /////////////////// // B.hxx #include "A.hxx" struct TypeB { auto f() { return TypeA{}; } }; auto TypeA::f() { return TypeB{}; } auto func(auto pobj, auto p) { // something happens here involving both TypeA and TypeB } I guess the more precise question to ask is that how are incomplete entities handled between modules? I haven't been able to find any relevant information on cppreference submitted by /u/geekfolk
...

Read full post
C++
Windows and C++ exceptions

(c) 2020 by [email protected] -- LICENSE_DBJ -- https://dbj.org/license_dbj/ What seems to be the issue? The issue seems to be it is not clearly documented how to use full and standard C++ and MS STL without C++ exceptions, on Windows. SEH build -- is cl.exe C/C++ build without any /EH switch or with a famous /kernel switch. SEH is intrinsic to Windows. SEH is in the foundations of Windows programming. I have made this little project to approve or disapprove your doubts. Also on the official side, things are happening around this issue: ...

Read full post
C++
Tool for "Go to definition"

Hello, as you know many IDE's/Editors feature a "Go to definition" command that finds the definition of whatever the cursor is currently on. If you have a large and complex program, these tools will/can only work if they know the build process. What tool can you recommend my for "Go to definition". I need one that not only works in most cases, but in all cases(so it needs to know the build process). The build process is a fork of gnu make, but I have a json compilation database that I generated using bear. ​ I basically need the rust language server, but for c++ instead of rust. submitted by /u/Volker_Weissmann
...

Read full post