I'm trying to read a file in binary format into a std::vector<std::byte>
std::ifstream fStream(fName, std::ios::binary);
std::vector<std::byte> file_content((std::istreambuf_iterator<std::byte>(fStream)),
std::istreambuf_iterator<std::byte>());
but I'm getting this error (which to me looks like istreambuf_iterator
is missing an overload for std::byte
)
error: no matching function for call to ‘std::istreambuf_iterator<std::byte>::istreambuf_iterator(std::ifstream&)’
std::vector<std::byte> file_content((std::istreambuf_iterator<std::byte>(fStream)),
Am I doing something wrong ? And if yes what is the best way to do this ?
Thanks!