mirror of
https://github.com/vimpunk/mio.git
synced 2025-12-06 08:46:51 +08:00
Follow up attempt to fix MSVC SFINAE build error
This commit is contained in:
parent
0da3002815
commit
261acc6bc6
@ -418,6 +418,25 @@ void basic_mmap<AccessMode, ByteT>::swap(basic_mmap& other)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<access_mode AccessMode, typename ByteT>
|
||||||
|
template<access_mode A>
|
||||||
|
typename std::enable_if<A == access_mode::write, void>::type
|
||||||
|
basic_mmap<AccessMode, ByteT>::conditional_sync()
|
||||||
|
{
|
||||||
|
// This is invoked from the destructor, so not much we can do about
|
||||||
|
// failures here.
|
||||||
|
std::error_code ec;
|
||||||
|
sync(ec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<access_mode AccessMode, typename ByteT>
|
||||||
|
template<access_mode A>
|
||||||
|
typename std::enable_if<A == access_mode::read, void>::type
|
||||||
|
basic_mmap<AccessMode, ByteT>::conditional_sync()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
|
||||||
template<access_mode AccessMode, typename ByteT>
|
template<access_mode AccessMode, typename ByteT>
|
||||||
bool operator==(const basic_mmap<AccessMode, ByteT>& a,
|
bool operator==(const basic_mmap<AccessMode, ByteT>& a,
|
||||||
const basic_mmap<AccessMode, ByteT>& b)
|
const basic_mmap<AccessMode, ByteT>& b)
|
||||||
|
|||||||
@ -370,18 +370,11 @@ private:
|
|||||||
* if it's `read`, but since the destructor cannot be templated, we need to
|
* 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.
|
* do SFINAE in a dedicated function, where one syncs and the other is a noop.
|
||||||
*/
|
*/
|
||||||
template<access_mode A = AccessMode,
|
|
||||||
typename = typename std::enable_if<A == access_mode::write>::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<access_mode A = AccessMode>
|
template<access_mode A = AccessMode>
|
||||||
typename std::enable_if<A == access_mode::read, void>::type conditional_sync() {}
|
typename std::enable_if<A == access_mode::write, void>::type
|
||||||
|
conditional_sync();
|
||||||
|
template<access_mode A = AccessMode>
|
||||||
|
typename std::enable_if<A == access_mode::read, void>::type conditional_sync();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<access_mode AccessMode, typename ByteT>
|
template<access_mode AccessMode, typename ByteT>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user