General C++ Programming (Page 2)

Why do we want perfect forwarding?
Hi, why should we use this code: do_print(std::forward<T>(arg)); instead of ...
[3 replies] Last: Does this code demonstrates the advantage of using perfect forwarding?... (by JUANDENT)
How to require all elements of a parameter pack to satisfy a concept?
See this code: template<typename...T> requires is_arithmetic_v<T>... int sum_by_fold(T...v) ...
[2 replies] Last: thanks!!! (by JUANDENT)
by jNc
get inputs from OS application even if app is not active
Having some app, made with x11 libs, tested for ubuntu. It takes simple keyboard inputs and outpu...
[2 replies] Last: I've googled a lot /dev/input but still not clue, how to get even smal... (by jNc)
Unable to link to a c++ dll from VB2019 (1,2)
I have upgraded all my projects to VS2019 and yet I still cannot get them to talk to each other betw...
[29 replies] Last: Hi all after, including the .def file in the youtube tutorial i manage... (by darkdave)
by StMick
Constructor Errors Between Classes
I'm building a LinkedList data structure with a nested Node class. The Node class within the LinkedL...
[2 replies] Last: Perhaps what you meant to do was LinkedList<Animal *> AList; AList.a... (by helios)
how can I compare the signatures of 2 functions when one of them is a lambda and the other is a regular function?
Please read this code and my explanation of the question after it: auto lambda = (unique_pt...
[3 replies] Last: #include <iostream> #include <memory> #include <array> #include <stri... (by mbozzi)
by StMick
Undefined Reference to User Defined Type
Hello! I have built a LinkedList template class and am trying to test out its functions on a user...
[3 replies] Last: All the template code should go into the header file. People are gener... (by Ganado)
How can I restrict a template parameter to a certain signature
Hi, I have a function template acting on a collection and receiving an operation whose signature ...
[1 reply] : #include <memory> #include <ranges> #include <vector> template < typ... (by JLBorges)
How to test if a container type holds unique_ptr as its elements?
Hi, I need a concept that specifies whether a container type's value_type is a specialization of ...
[4 replies] Last: > would that concept hold true even for a std::map ? No. The value_... (by JLBorges)
Why do I get segmentation fault error?
I am usually pretty good at catching the root of segmentation fault error except this time. I have t...
[6 replies] Last: @Peter87 You are right actually! Thanks! (by JamieAl)
which callable object requires std::forward when passed as an argument?
In which cases, when is it important to call std::forward<L>(lambda) as in the following 2 functions...
[4 replies] Last: So here is a minimal example what std::forward does: #include <iostrea... (by coder777)
by frek
std::bind(function, argsā€¦) returns a function object that is the result of the given arguments t...
[18 replies] Last: Right. Thanks for your time and info. (by frek)
implementation of std::exchange is not clear...
Some code from the standard that has some tricks I do not understand: EXPORT_STD template <c...
[3 replies] Last: No, you're right. I misread. (by mbozzi)
How does a default move ctor deal with pointers?
Hi, Depending on how the compiler implements the default move ctor, this code could duplicate the...
[2 replies] Last: Compiler-generated move constructors copy trivial sub-objects and move... (by mbozzi)
by frek
Callback vs callable object vs function
I'm rather confused about terminology. I think a callback and a callable object are exactly the...
[7 replies] Last: OK, thank you very much. (by frek)
by oddy
About type inference for function templates
I use the function read to read an integer from stdin in the code below: #include <cstdio>...
[2 replies] Last: With C++20 it is possible to get a bit of narrowing for parameters wit... (by George P)
Error in reading a byte from a file.
Hello, I am trying to read bytes from a file but it's just not working... My program reads graphic...
[11 replies] Last: Not sure what I did but its working now. It might have been to do with... (by Cyclone)
by Atom1
Register assembly in C++
We hired someone to build a wrapper dll so that our application could use functions in a managed .Ne...
[2 replies] Last: You could call ShellExecuteW() with lpOperation set to "runas" ... (by kigar64551)
Will the 2nd -std=gnu++14 override the 1st -std=c++17 ?
A naive concept question: while I'm building a file/folder, for instance, here, I'm trying to buil...
[1 reply] : The man gcc either does not mention, or hides the info from casual r... (by keskiverto)
Pages: 12
  Archived months: [jul2023]

Cannot post in this page. To post a new message, go to the first page.