diff --git a/include/mio/detail/mmap.ipp b/include/mio/detail/mmap.ipp index a813fc3..a068891 100644 --- a/include/mio/detail/mmap.ipp +++ b/include/mio/detail/mmap.ipp @@ -418,6 +418,25 @@ void basic_mmap::swap(basic_mmap& other) } } +template +template +typename std::enable_if::type +basic_mmap::conditional_sync() +{ + // This is invoked from the destructor, so not much we can do about + // failures here. + std::error_code ec; + sync(ec); +} + +template +template +typename std::enable_if::type +basic_mmap::conditional_sync() +{ + // noop +} + template bool operator==(const basic_mmap& a, const basic_mmap& b) diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index fd18d2b..2d18cd9 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -370,18 +370,11 @@ private: * if it's `read`, but since the destructor cannot be templated, we need to * do SFINAE in a dedicated function, where one syncs and the other is a noop. */ - template::type> - void conditional_sync() - { - // This is invoked from the destructor, so not much we can do about - // failures here. - std::error_code ec; - sync(ec); - } - template - typename std::enable_if::type conditional_sync() {} + typename std::enable_if::type + conditional_sync(); + template + typename std::enable_if::type conditional_sync(); }; template