online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <thread> #include <vector> void f(std::vector<double> & vd) { for (auto & v : vd) std::cout << "From f -> " << v << std::endl; } struct F { std::vector<double> & vd; F(std::vector<double> & _vd) : vd{ _vd } {} void operator() (); }; void F::operator()() { for (std::vector<double>::iterator it = vd.begin(); it != vd.end(); ++it) std::cout << "From F -> " << *it << std::endl; } int main() { std::vector<double> vd{ 2.5, 5.5, 7.1 }; std::vector<double> vd2{ 10.5, 15.5, 21.4 }; //std::thread t0{f, vd}; //<-- Error : No type named type in clas std::result_of))(std::vector&)> Si comento esta linea compila... std::thread t1{ F(vd2) }; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue