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

I have a list of callbacks to invoke whenever some event happens and I would like to allow subscribing to it without having to explicitly call the subscribing function: // subscription.h #include <...
Dominik Kaszewski's user avatar
1 vote
3 answers
180 views

I'm trying to read a string of numbers from a file, delimited by spaces, and then generate a vector of integers from the input using ranges. std::ifstream infile; infile.open("student.txt"); ...
yoong jin chow's user avatar
-5 votes
0 answers
117 views

The game I'm making using C++ requires a linked list like structure to make worms, but I'm unable to figure out how to declare and use nextnode within my worm object. Here's my code of whatever I ...
Ro Man's user avatar
  • 1
1 vote
0 answers
147 views

I am attempting to use C++ modules with reflection. When I #include <meta> things compile and work. Using import std; instead causes compiler errors. import std; does work so long as I am not ...
Graznarak's user avatar
  • 3,900
Best practices
0 votes
7 replies
183 views

I am working on a device where the I/O is incredibly slow and I have to SHA256 hash some data. So, I thought that I would use a double buffer to at least be able to do some I/O whilst the hash is ...
The Welder's user avatar
  • 1,099
8 votes
1 answer
311 views

I stumbled upon this code: struct type1 { int a; }; struct type2 { int a; type1 agg; int b; }; struct deducer { operator type1() { return type1{}; } }; auto main() -> int { ...
Guillaume Racicot's user avatar
1 vote
1 answer
119 views

[intro.object] seems to say that implicit object creation, at least for operations that return a pointer, occurs at the returned location (https://eel.is/c++draft/intro.object#14 and https://eel.is/c++...
Oersted's user avatar
  • 5,070
3 votes
1 answer
126 views

I'm trying to create a vector from an input range in a template code. Instead of using the begin - end constructor, I figured std::from_range constructor would be better in terms of readability and ...
Burak's user avatar
  • 2,632
-2 votes
1 answer
81 views

On a Debian 13 OS, I have an Apache Kafka with roles Controller,Broker started by a: #!/bin/bash # Configuration KAFKA_VERSION="4.1.1" CONTAINER_NAME="kafka-beaufort" CLUSTER_ID=&...
Marc Le Bihan's user avatar
Advice
2 votes
13 replies
233 views

I’m trying to manage dynamic memory safely, but I don’t understand when to use unique_ptr or shared_ptr. #include <memory> std::unique_ptr<int> uptr = std::make_unique<int>(10); std::...
Lennis Ngugi's user avatar
0 votes
0 answers
129 views

Can anyone shed light on why this fails to terminate correctly (always hanging or crashing) on Windows MSYS2 using Boost 1.91.0? The issue also occurs with Boost 1.90.0 and Boost-1.89.0 (built from ...
AntVival's user avatar
Best practices
0 votes
1 replies
41 views

I'm wondering whether the result of comparing collation sort keys (= already pre-processed strings for faster collation-compatible sorting/searching) is a strong or weak ordering. The implementation ...
Marc Mutz - mmutz's user avatar
3 votes
3 answers
155 views

I am trying to make a simple timer in C++ using the <chrono> library. My code is as follows: #include <iostream> #include <chrono> int main() { double timer; std::chrono::...
Vinayak Deshmukh's user avatar
-1 votes
0 answers
50 views

I am trying to utilize the ESP32-AudioI2S library with my Arduino Nano esp32, and have run into an issue with compilation, specifically regarding the aforementioned library. The error message directs ...
AmiCaz's user avatar
  • 1
Advice
1 vote
7 replies
124 views

I have been studying C++ for a bit of time now. I am still a novice, but I continue to learn daily and practice and pickup new things. One thing I haven't been seeing too much information on is ...
Korp4332's user avatar

15 30 50 per page
1
2 3 4 5
54313