Boy, am I beginning to hate C++, and here's one of the reasons why:
Me (to compiler):
Compiler (to me): 'important_function' : cannot convert parameter 1 from 'std::ifstream' to 'std::istream'Code:#include <fstream> int important_function(std::istream ){ return 0; } int main() { std::ifstream f("dummy_file"); important_function(f); return 0; }
Me (to compiler): How about this?
Compiler (to me): 'important_function' : cannot convert parameter 1 from 'std::istream' to 'std::istream'Code:#include <fstream> int important_function(std::istream ){ return 0; } int main() { std::ifstream f("dummy_file"); important_function(*(reinterpret_cast<istream *>(f))); return 0; }
I ended up using a reference, which I don't need. I only need the value. Why can't it just copy the damn structure? Is there any way to make it to?
Thank you for your time :-)