mapped file fixes.

This commit is contained in:
Kelvin Sherlock 2017-03-04 14:07:19 -05:00
parent 3e3be4f9e3
commit b74f0e59ee
2 changed files with 10 additions and 4 deletions

View File

@ -27,8 +27,14 @@ namespace {
throw_error(GetLastError());
}
void throw_error(const char *what) {
int e = GetLastError();
throw_error(e, what);
}
void throw_error(const std::string &what) {
throw_error(GetLastError(), what);
int e = GetLastError();
throw_error(e, what);
}
}

View File

@ -96,7 +96,7 @@ public:
}
value_type *data() {
return _flags == readonly ? (value_type *)nullptr : (value_type *)_data;
return (value_type *)_data;
}
const_iterator cbegin() const {
@ -119,11 +119,11 @@ public:
iterator begin() {
return _flags == readonly ? (iterator)nullptr : (iterator)_data;
return (iterator)_data;
}
iterator end() {
return _flags == readonly ? (iterator)nullptr : (iterator)_data + size();
return (iterator)_data + size();
}
mapmode flags() const {