hi,
the thing is i am trying to pass ifstream as argument to thread but i get the following error:-
error: no type named ‘type’ in ‘class std::result_of<void (*(std::basic_ifstream<char>))(std::basic_ifstream<char>)>’
typedef typename result_of<_Callable(_Args...)>::type result_type;
how do i pass the ifstream argument to the function being called on thread
heres my code below
actually when i run the modified program on my machine with c++11 enabled it gives this error:-
no type named ‘type’ in ‘class std::result_of<void (*(std::basic_ifstream<char>))(std::basic_ifstream<char>)>’
typedef typename result_of<_Callable(_Args...)>::type result_type;
Actually , I see in gcc 4.9.3, where the actual error is "use of deleted function 'std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)'" (attempt to copy a stream), the first line of the error message that says "error:" in it says "usr/local/gcc-4.9.3/include/c++/4.9.3/functional:1665:61: error: no type named 'type' in 'class std::result_of<void (*(std::basic_ifstream<char>))(std::basic_ifstream<char>)>' typedef typename result_of<_Callable(_Args...)>::type result_type;" which sounds like your situation. gcc did not really have C++11 until 5.x