prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:40:26: error: invalid initialization of non-const reference of type ‘std::basic_ifstream<char>*&’ from an rvalue of type ‘std::ifstream* {aka std::basic_ifstream<char>*}’
CFileReader file_reader(&file);
^~~~~
prog.cpp:17:2: note: initializing argument 1 of ‘CFileReader::CFileReader(T&) [with T = std::basic_ifstream<char>*]’
CFileReader(T& v) : obj(&v) {};
^~~~~~~~~~~
prog.cpp:44:29: error: no matching function for call to ‘std::vector<IReadable*>::push_back(CMemoryReader*)’
vv.push_back(&memory_reader);
^
In file included from /usr/include/c++/6/vector:64:0,
from prog.cpp:3:
/usr/include/c++/6/bits/stl_vector.h:914:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = IReadable*; _Alloc = std::allocator<IReadable*>; std::vector<_Tp, _Alloc>::value_type = IReadable*]
push_back(const value_type& __x)
^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:914:7: note: no known conversion for argument 1 from ‘CMemoryReader*’ to ‘IReadable* const&’
/usr/include/c++/6/bits/stl_vector.h:932:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = IReadable*; _Alloc = std::allocator<IReadable*>; std::vector<_Tp, _Alloc>::value_type = IReadable*]
push_back(value_type&& __x)
^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:932:7: note: no known conversion for argument 1 from ‘CMemoryReader*’ to ‘IReadable*&&’