Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

I have recently tried installing VTK 9.5 on Ubuntu 24.04 from source (latest .tar.gz release) but when I compile a really simple example code the window doesn't show up. I would like my vtk ...
Alfred Lalanne's user avatar
0 votes
0 answers
42 views

Consider this example: #include <thread> #include <atomic> int main(){ std::atomic<int> x = 0, y = 0; auto t1 = std::thread([&](){ if(x.load(std::memory_order::relaxed)==...
xmh0511's user avatar
  • 7,578
0 votes
2 answers
86 views

So the question given to me is to make a C++ program where the user inputs the size (declared by n) of a matrix N x N, and then there's a function for the user to fill the matrix called inputMatrix #...
Dustin Ivander's user avatar
0 votes
0 answers
47 views

I'm attempting to narrow a screenshot of an app to a specific section of the UI for later processing by Tesseract; in particular, the X Battle ratings located in the lower half of the image. I did a ...
SystemNeo's user avatar
1 vote
0 answers
72 views

According to modern C++ guidelines, we should prefer uniform initialization everywhere, for example: int x{0}; However, when I try to combine uniform initialization with C++20’s designated ...
rafoo's user avatar
  • 1,676
4 votes
2 answers
112 views

I'm writing a header-only library which defines class X in header x.hpp. The implementation of X is different for different standard versions: #if __cplusplus < 201703 class X { int a; ...
yuri kilochek's user avatar
0 votes
0 answers
31 views

In a previous thread I asked about listing real filenames stored on a Portable Device (e.g. an MTP Digital Camera). Per my answer I can now traverse the file system and display real filenames. Now I ...
gene b.'s user avatar
  • 12.6k
Advice
3 votes
7 replies
220 views

Off the top of my head, I only remember LLVM's standard library do this, but I remember seeing other libraries also do this. I'm not entirely sure what is the advantage here. I feel like namespace std ...
Somedude's user avatar
-1 votes
1 answer
64 views

The idea is for my Windows app to exchange QUIC data with a browser. Upon creating a server with msquic and nghttp3, I'm not sure why chrome says Failed to establish a connection to https://host.com:...
Michael Chourdakis's user avatar
0 votes
0 answers
82 views

I've been working on a C++ project. I have been using 2 Windows PCs for building it and both worked fine with the same (kinda janky) setup. I recently got a new computer and I get a linker error. My ...
indjev99's user avatar
  • 122
-5 votes
0 answers
81 views

I am on Windows 11. I downloaded and installed the Vulkan SDK on my Windows machines. When I try to compile, I keep seeing: vulkan/vulkan.h: No such file or directory I have installed: C:\VulkanSDK\1....
John Smith's user avatar
-3 votes
0 answers
72 views

How can I get autoindentation to use Whitesmith style for C/C++ files in VSCode? I use Microsoft C/C++ Extension pack and clang-format. "Format Document" works ok with C/C++ files.
tohoyn's user avatar
  • 161
-3 votes
0 answers
84 views

I am implementing ghost behavior in a Pac-Man clone, specifically the behavior when ghosts are inside the ghost house during the waiting phase. The issue is that ghosts inside the ghost house do not ...
Amir Reza Sa's user avatar
-3 votes
0 answers
110 views

I have a solution where I need to write a custom allocator that uses a std::vector as storage for the objects allocated with it. I'm using a std::shared_ptr for the std::vector, and I know that it ...
Georgii Strokov's user avatar
-4 votes
0 answers
76 views

I am trying to use the Open Cascade library to create a model converter (DLL). The Open Cascade library contains many DLLs and Libs I have specified the additional libraries TKDEGLTF.lib TKMesh.lib ...
craig1231's user avatar
  • 3,888
2 votes
1 answer
161 views

I write a cross-platform program for Windows and Linux, and I would like it to behave as similar on both platforms as possible. I use some mathematics in the program, e.g. std::atan2 function calls, ...
Fedor's user avatar
  • 24.7k
-1 votes
1 answer
133 views

Can somebody explain what does this code do? template <typename... Types> auto maketuple(Types&&... args){ return std::tuple<Types...>(std::forward<Types>(args)...); } ...
cryptic-mortal's user avatar
1 vote
1 answer
93 views

I want to set up a watchdog that checks whether the io_context workers can pick up tasks within a reasonable time and are not stuck running long or blocking operations. To achieve this, I've ...
Zohar81's user avatar
  • 5,214
0 votes
0 answers
129 views

I'm experimenting with std::unordered_map performance in C++20 and noticed that when I insert a large number of elements, the container sometimes rehashes multiple times even though I called reserve() ...
Kenz Bilal's user avatar
2 votes
1 answer
128 views

While evaluating thread pool libraries for short-running tasks, I noticed that they all performed significantly worse than OpenMP. The root cause seems to be that other libraries struggle to start ...
BlueSky's user avatar
  • 259
-3 votes
0 answers
90 views

I have this part of my code where I have an array and want to compare it with other constant arrays, to find a match. As I am working with Multi-dimensional arrays, I decided to store these constants ...
grdj's user avatar
  • 1
1 vote
0 answers
61 views

I can draw a rectangle without errors if I use unsigned int or uint32_t in indices[] and I have 2 questions: Why do I get a triangle when using uint8_t? I get nothing if its 2 bytes (uint16_t) ? No ...
Umut Kaya Bal's user avatar
5 votes
0 answers
102 views

I am trying to develop a system audio recording application which uses the application loopback method provided by WASAPI. I'm basing my implementation upon the Windows classic samples application ...
fahdIm's user avatar
  • 21
-5 votes
0 answers
107 views

I installed the new Visual Studio 2026, and last I checked reflect.h from reflect-cpp was compiling, but no longer. It gives a internal compiler error C1001. The version I'm using is 18.0.2 (from the ...
Zebrafish's user avatar
  • 16.3k
0 votes
1 answer
112 views

I want to remove the comma characters inside __VA_ARGS__. I have found a FOR_EACH implementation, which kind of solves it, but gives cluttered error messages when there is a mistake. My problem has ...
clash's user avatar
  • 101
4 votes
1 answer
138 views

Given the following three source files (main.cc, a.cc, b.cc): // main.cc #include <iostream> #include <string> std::string get_a(); int main() { std::cout << get_a() << '\n';...
Markus's user avatar
  • 3,487
0 votes
0 answers
36 views

I'm trying to debug memory issues on an embedded Linux system (C++ application). I want to use jemalloc for it. I managed to build jemalloc and link my sample application against it, and it detects ...
DrP3pp3r's user avatar
  • 889
Advice
1 vote
1 replies
90 views

Why can't we put a constraint on the first type parameter of the concept? Why can't we use the short form of the concept for non-type parameter? Why is it possible to specialize concepts only in ...
ValeriyKarasikov's user avatar
Best practices
2 votes
5 replies
122 views

I am trying to generalise a class that can accept different types, but also optionally accept multiple types. The class must use virtual functions. For a single type a specialised class might look ...
asdfsdgf's user avatar
-1 votes
0 answers
52 views

I’m dealing with a repeated crash in a custom Linux application and hoping to get advice or confirmation or suggestion on the root cause. The application connects to an SFTP server, downloads a daily ...
Muhammad Myy's user avatar
3 votes
1 answer
116 views

Consider the following translation unit: export module Example; export inline void fn1(); export void fn2(); export void fn3(); void fn1() {} void fn2() {} module :private; void fn3() {} Firstly, ...
Tristan Brindle's user avatar
-1 votes
1 answer
130 views

I refer to this answer. The example is for the integral type int. Replacing it by a class, the example doesn't work and the expression static int const value = sizeof(f<Derived>(0)); resolves ...
Peter VARGA's user avatar
  • 5,327
2 votes
1 answer
182 views

I am trying to come up with a way to determine, whether a given format string is valid for a given Type at compile time. I was expecting for a simple concept to work: template<typename T> ...
Jens's user avatar
  • 143
-4 votes
0 answers
109 views

I'm building a Visual Studio solution, consisting out of 54 projects. There are several error lines, the first is: The system cannot find the file '!(bindpath.bin)\somefile.dll'. In the output ...
Dominique's user avatar
  • 17.6k
4 votes
0 answers
193 views
+50

Consider this example: #include <atomic> #include <cassert> #include <thread> int main() { std::atomic<int> strong = {3}; std::atomic<int> weak = {1}; auto t1 ...
xmh0511's user avatar
  • 7,578
11 votes
1 answer
647 views

Consider the following simplified code: template <class T> class Foo { T t; const T* t_ptr; public: constexpr Foo(T t): t(t), t_ptr(&this->t) {} constexpr Foo(const Foo&...
eyelash's user avatar
  • 4,126
0 votes
0 answers
86 views

This question is a follow-up of std::bit_cast padding and undefined behavior. This "revival" is motivated by my answer to Accessing object storage where I proposed a function to modify a ...
Oersted's user avatar
  • 3,834
0 votes
1 answer
67 views

On Regex101, I have simple Regex with a named capture group in ECMAScript flavor: (?<name>.*) I'm trying to do the same thing in C++: #include <iostream> #include <regex> using ...
Thomas Weller's user avatar
Best practices
2 votes
8 replies
186 views

I need to define several constant strings that will be used across an entire C++20 project. I am considering the following options : constexpr char[] str1 = "foo"; constexpr std::string str2 ...
Autechre's user avatar
  • 633
1 vote
1 answer
94 views

Suppose I have a unity build: //impl1.h //impl1.cpp -> #include s impl1.h //impl2.h //impl2.cpp -> #include s impl2.h AND impl1.h //main.cpp #include "impl1.cpp" #include "impl2....
One_Cable5781's user avatar
2 votes
0 answers
51 views

I’d like to know whether it’s possible to change the background color of a wxButton when the mouse is hovering over it. On Windows, I tried handling the enter/leave window events, but it seems the ...
Reza's user avatar
  • 4,089
5 votes
0 answers
227 views

I am writing an embedded OS to run on Risc-V. As part of that, I'm implementing a FIFO for UART buffering using the classic single consumer/single producer module. The class looks like this: template &...
Shachar Shemesh's user avatar
3 votes
0 answers
118 views

Having issues finding a syntax for hoisting constrained member function outside of its class that GCC is happy with. At this point I'm starting to think it's a GCC bug. struct S { template<...
Thibaut's user avatar
  • 2,450
9 votes
1 answer
615 views

I noticed a discrepancy between C++23 and C++26 code when using googlemock: enum A { A1, A2 }; enum B { B1, B2 }; TEST(...) { ASSERT_EQ(A1, B1); // compiles fine in C++23 and C++26 ASSERT_THAT(...
PiotrNycz's user avatar
  • 25.1k
2 votes
0 answers
126 views

Consider this example: #include <iostream> #include <atomic> #include <thread> #include <cassert> int main(){ std::atomic<int> val = 1; std::atomic<std::atomic&...
xmh0511's user avatar
  • 7,578
9 votes
1 answer
485 views

Consider this code: #include <cstddef> #include <iostream> const double cash = 1000; int main() { size_t my_size_t_value = 2; double my_double_value = -my_size_t_value*...
Joe Chakra's user avatar
2 votes
1 answer
108 views

First of all, Qt version is 6.10.0, testing on Arch Linux rolling. I think I've found a bug in Qt but maybe it's just my fault. My program asks MariaDB database for some data and displays it in ...
Drobot Viktor's user avatar
1 vote
0 answers
61 views

I am using WASAPI loopback for real time audio visualization, and I am seeing some pretty significant distortion. When I play back a 25Hz tone from Audacity (and other programs) and record the samples ...
Chris_F's user avatar
  • 5,864
5 votes
2 answers
113 views

I have a QColumnView with a QFileSystemModel attached to it, and I am trying to get information on what file is being hovered over in that model view. I do have mouse tracking enabled, however it ...
James Bell's user avatar
-3 votes
1 answer
153 views

I'm trying to open a file as output so that I can write converted model data to my file. The problem currently is, even though the path does exist, and the file is created, it isn't actually open. I'...
DefinitelyNotAFreak's user avatar