diff --git a/include/mio/detail/mmap.ipp b/include/mio/detail/mmap.ipp index 2045cd1..be6ef92 100644 --- a/include/mio/detail/mmap.ipp +++ b/include/mio/detail/mmap.ipp @@ -324,7 +324,9 @@ void basic_mmap::map(const handle_type handle, } template -void basic_mmap::sync_impl(std::error_code& error) +template +typename std::enable_if::type +basic_mmap::sync(std::error_code& error) { error.clear(); if(!is_open()) diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index 694d9f4..2e69e63 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -341,13 +341,9 @@ public: void swap(basic_mmap& other); /** Flushes the memory mapped page to disk. Errors are reported via `error`. */ - template< - access_mode A = AccessMode, - typename = typename std::enable_if::type - > void sync(std::error_code& error) - { - sync_impl(error); - } + template + typename std::enable_if::type + sync(std::error_code& error); /** * All operators compare the address of the first byte and size of the two mapped @@ -378,15 +374,6 @@ private: conditional_sync(); template typename std::enable_if::type conditional_sync(); - - /** - * Due to MSVC's fragile SFINAE support (see - * https://github.com/mandreyel/mio/issues/300), we need to have `sync` - * defined inline so that `conditional_sync` sees the definition. To not - * clutter the API, the implementation is extracted into this non-SFINAE - * private member function. - */ - void sync_impl(std::error_code& error); }; template