Merge pull request #5 from lukediamond/master

Fixed mutable begin() for basic_mmap.
This commit is contained in:
mandreyel 2018-04-15 18:41:59 +02:00 committed by GitHub
commit b6ca040f1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,7 +151,10 @@ public:
* Returns an iterator to the first requested byte, if a valid memory mapping
* exists, otherwise this function call is equivalent to invoking `end`.
*/
iterator begin() noexcept { return impl_.begin(); }
template<
access_mode A = AccessMode,
typename = typename std::enable_if<A == access_mode::write>::type
> iterator begin() noexcept { return impl_.begin(); }
const_iterator begin() const noexcept { return impl_.begin(); }
const_iterator cbegin() const noexcept { return impl_.cbegin(); }