10 questions from the last 1 days
2
votes
3
answers
100
views
C++ std::span overload resolution
I want to pass a C-style array to a function taking a std::span, but overload resolution chooses to convert the array to bool instead. Is this behavior required by the standard, or is it a compiler ...
-8
votes
0
answers
62
views
Using libcurl multi interface in a C++ program, but it only works if there is only one transfer at a time [closed]
I'm writing an application in C++ using libcurl, designed to handle multiple http requests simultaneously, so I'm using the libcurl multi interface. I'm using libcurl 8.17.0 on a Rocky 8 Linux machine ...
-4
votes
1
answer
78
views
How should ACKs be handled for a 10 byte packet traveling across communication hops, starting from a JS client (BLE → UART → MCU → UART → BLE) [closed]
Architecture:
React/Ionic → BLE → ESP32 → UART → PIC16F (authoritative ACK)
→ UART → ESP32 → BLE → React/Ionic
Problem:
I currently use exponential backoff for most commands, which has been reliable ...
2
votes
2
answers
145
views
How to avoid implicit conversion in C++ concepts?
Is there a way to prevent implicit conversions happening in concepts? For example, this example compiles with GCC and clang when I actually want it to give an error that the char constructor is ...
1
vote
2
answers
93
views
Detect existence of name in at least one base class
This code (reduced from the Chromium codebase) is accepted by Clang but rejected by GCC:
template<class T> concept Concept = requires {typename T::marker;};
#define INJECT_MARKER using marker = ...
0
votes
0
answers
94
views
File IO in C++ (or C) without the overhead of copying between two buffers with Linux Systems [closed]
I'm interested to understand more about performing file IO operations with systems programming languages in a way which does not use both a kernel space buffer and a user space buffer.
Specifically I ...
2
votes
2
answers
79
views
Rust and C++ FFI: orchestrating destructors/drops of struct fields
Because of some FFI code interacting with C++ I need precise manual control on when the Drop::drop() method of types is called w.r.t. those of fields.
To be more precise:
When a C++ struct is ...
0
votes
1
answer
34
views
Why is this GTK+ C++ program not showing a button with a black rectangular box boundary as expected?
I have the following HDSentinel.cpp program designed to run under the GTK+ library environment. I had a simple Hello.cpp program that I tried to adapt so that the "Hello World" button would ...
1
vote
2
answers
107
views
Issue with multithreaded/concurrent use of ReadFile() Windows API
I'm currently working on a project that requires a multi-threaded approach. This project is currently platform specific, i.e. Windows.
This is how my read code looks like:
#pragma once
#include <...
-4
votes
0
answers
37
views
std::regex_match outputs false when it should output true [duplicate]
I am just learning how to work with regular expressions in C++. I wrote a test program to see if a would match the string "abc", but the program outputted 0.
Here's the code:
#include <...