
please wait
by JUANDENT
How come a concept receives 2 template parameters but only one is used?
|
How come a concept receives 2 template parameters but only one is used? Here is use of concept Arithmetic in requires clause (2 template parameters) ... |
Aug 25, 2024 at 2:50pm
[1 reply] : There are two syntaxes involved, both of which ultimately supply the s... (by DizzyDon)
|
by LsDefect
Parameters and move semantics
|
Here's some error logging code in my program (basically): void SetError(std::string&& arg){ error = arg; } try { // something } catch (st... |
Aug 21, 2024 at 2:59am
[10 replies] Last: I think I've actually got a handle on this now - thank you very much! (by LsDefect)
|
by JUANDENT
why pass by universal reference?
|
I understand by universal reference the argument passing following this pattern: template<typename T> void f(T&& t) as in template< class Exe... |
Aug 18, 2024 at 8:23am
[1 reply] : Universal references are useful when you want to move the argument if ... (by Peter87)
|
by JUANDENT
Cannot convert from T to T&
|
Cannot convert from T to T& as in the following: auto f(const map<string, int>& mp) { auto p = find_if(mp.begin(),mp.end(), Greater_than{ 42 }); return p; ... |
Aug 17, 2024 at 10:08am
[4 replies] Last: Is there any harm in using auto&&? No, I don't think so. does f re... (by Peter87)
|
by JUANDENT
How to write a concept that requires one to create an object to specify that that constructor must exist
|
I need to write the following concept: template<typename T> concept Element = requires (T a, T b) { a = b; T c{ a }; }; I know I can do ... |
Aug 9, 2024 at 8:41pm
[no replies]
|
by JUANDENT
what are the differences between returning auto, auto&, auto&& and decltype(auto)?
|
what are the differences between returning auto, auto&, auto&& and decltype(auto)? for instance: auto f(int val) { static int value = val; return va... |
Aug 8, 2024 at 6:59pm
[1 reply] : For auto and decltype(auto): https://stackoverflow.com/questions/2136... (by deleted account xyzzy)
|
by JamieAl
Error: Using EigenFFT in for loop
|
I am testing EigenFFT with some Eigen tensors and matrices. I have been so far successful with implementing 1D FFTs along different directions and comparing my ... |
Aug 6, 2024 at 10:17pm
[no replies]
|
by seeplus
what #define are defined
|
Within VS or other, for each source file of a solution/project is there a way of obtaining a list of all #define symbols (including within #include files) and t... |
Aug 6, 2024 at 3:29pm
[3 replies] Last: Thanks. I missed that one........ (by seeplus)
|
by JUANDENT
are these assignments to temporary valid?
|
Hi, I have this code where I am not sure the assignments are valid: int g(double x) { return std::floor(x); } double& h(double x) { return x; } // return... |
Aug 3, 2024 at 8:18am
[1 reply] : h and i return dangling references. All big compilers (GCC, Clang ... (by Peter87)
|
by JUANDENT
vector of unique_ptrs - how to initialize?
|
Hi, I have a vector of std::unique_ptr<Shape> but cannot initialize it. I tried: vector<std::unique_ptr<Shape>> v{ std::unique_ptr<Shape>(new Circle... |
Aug 3, 2024 at 8:07am
[7 replies] Last: std::initializer_list only gives const access to the elements. You c... (by Peter87)
|