Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Error with move capture of a const ref in a lambda function
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 #include <utility> struct T { int a; }; void f(const T &t) { // T v = std::move(t); // this works auto l = [u=std::move(t)] // this works both with gcc and clang { }; } int main() { return 0; }
run
|
edit
|
history
|
help
0
Ctor takes const reference but pass in a non-const array
Use std::is_base_of to subset STL container contents.
multiply linked list numbers
derived_tempalte
0004
For NULL-embedded strings, CStringT::Find() produces what you may not expect
c++functor
inherited
Memory example
unresolved external symbol