Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 03 July 2012 - 06:25 AM
Posted 03 July 2012 - 08:49 AM
Edited by BitMaster, 03 July 2012 - 08:49 AM.
Posted 03 July 2012 - 09:02 AM
Posted 03 July 2012 - 09:11 AM
Posted 03 July 2012 - 10:13 AM
#include<iterator> std::ifstream testFile("testfile", std::ios::binary); // ... std::vector<char> fileContents; fileContents.reserve(fileSize); fileContents.assign(std::istreambuf_iterator<char>(testFile), std::istreambuf_iterator<char>());
Edited by Cornstalks, 03 July 2012 - 10:21 AM.
Posted 03 July 2012 - 10:25 AM
Posted 03 July 2012 - 11:23 AM
That was because his first reversion was, which he fixed (see his response to James McNellis's comment).
@Cornstalks: when I initially googled for the topic, I found this stackoverflow thread as well, but just as James McNellis writes a few comments below, this does not actually seem to be standard compliant. I still have to look it up in the standard to get confirmation though.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.