Since you're already using boost, take a look at boost::iostreams::mapped_file_source http://www.boost.org/doc/libs/release/libs/iostreams/doc/classes/mapped_file.html#mapped_file_source
You can use file.data() as the begin iterator and file.data() + file.size() as the end iterator.