General C++ Programming - January 2023

indirectly_readable is false for std::optional??
 
Hi, I do not understand the following: The resulting value when applying the operator* is the s...
[1 reply] : The resulting value when applying the operator* is the same reference... (by mbozzi)
TEXT like behavior of the function?
 
I have a lengthy function that is bloated because there doesn't seem to be a way to assign generic s...
[5 replies] Last: Awesome solution and no performance penalty, I like it! Macros again s... (by malibor)
trick with type_identity_t
 
Hi, I do not understand the following code: template<typename From, typename To> concept Convert...
[2 replies] Last: type_identity_t<To > is used here to satisfy an arbitrary restrictio... (by mbozzi)
std::compare_three_way not compiling
 
Hi, I have this code: template<typename T> struct Value { T val{}; auto operator<=>...
[6 replies] Last: cppreference has excellent examples on how to use C++ stdlib functiona... (by deleted account xyzzy)
(c++ stl thread) what happen when constructing threads without join() or detach()?
 
code below: #include<iostream> #include<thread> using namespace std; int main() { ...
[3 replies] Last: Please do not post the same question in multiple forums. https://cplus... (by AbstractionAnon)
Conditionally use function with templates
 
Generic sample code: #include <string> #include <type_traits> #include <cuchar> template<typena...
[5 replies] Last: template < std::ranges::input_range STR > requires requires { int... (by JLBorges)
Internal compiler error MSVC
 
Creating a new thread since the previous one is solved: https://cplusplus.com/forum/general/285225/ ...
[3 replies] Last: It's the latest compiler version and I was compiling with std:c++20 G... (by malibor)
What is the "z" prefix in string literals?
 
Sample string: std::string str = "z\u00df\u6c34\U0001F34C"; // or u8"zß水🍌" I don't underst...
[3 replies] Last: lol, silly me... Now that you said that it actually makes sense. (by malibor)
Can UTF-16 file be BOM-less?
 
UTF-8 encoded file may or may not have BOM in it, does the same apply to UTF-16? Can there be UTF...
[2 replies] Last: Thanks, I see, therefore it's possible for UTF-16 file be without BOM.... (by malibor)
regex_search icase
 
Sample code: #include <regex> #include <string> int main() { std::wregex regex; std::wst...
[7 replies] Last: The expensive part of constructing a typical regex is probably the pro... (by mbozzi)
convert string to hex
 
Hello all , Please how can convert this string to hex .. string packet = "11101111000001010110000...
[11 replies] Last: thanks so much Ganado , Working good Thanks for the notes jonnin ... (by Hawlong)
Different behavior in Debugger or normal application
 
Hi, I'm trying to develop a socket application in Linux (I don't know if it's a specific socket p...
[3 replies] Last: It took 15 minutes to install valgrind and receive the following: ==1... (by Bengbers)
how can replace and add to array
 
#include <iostream> using namespace std; // function to convert decimal to binary void decToBinar...
[6 replies] Last: Thanks so much seeplus , solved (by Hawlong)
by Mobo01
KMP algorithm's time complexity
 
I'm attempting to implement strstr using the KMP method. This is the algorithm described on scaler t...
[4 replies] Last: [quote=seeplus]As for once I'm feeling in a goof mood.. Typo?? Eithe... (by deleted account xyzzy)
regex_match issue
 
I never used regex in cpp and I'm having issue with the following sample: int main() { // Get lin...
[no replies]
File manager
 
Someone Please help Tools: - C++ - SDL 1.2.15 - CodeBlocks 20.03 Functionality: 1) Checking ...
[3 replies] Last: @zaneemma - What is your knowledge of C++? Do you know about std::file... (by seeplus)
by PeteDD
Link-time undefined reference to a class object (revisiting...)
 
This issue eludes me … once again. Undefined reference to a class object. It is similar to one w...
[7 replies] Last: You could make myADC a pointer Or a function-local static variable (... (by mbozzi)
Neural Network does not work the right way
 
Hi all, I have recently been working on a C++ NeuralNetwork class and wanted to feed it with imag...
[7 replies] Last: Hey, this is a C++ forum, not a BASIC forum! :) (by Ganado)
vcpkg + Boost + ICU + Windows 10
 
Anyone familiar with vcpkg on Windows? I just installed it and then ran the      vcpkg ...
[12 replies] Last: The amusing part of this discussion about vcpkg is I have (for me) a n... (by deleted account xyzzy)
  Archived months: [dec2022] [feb2023]

This is an archived page. To post a new message, go to the current page.