summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-03-14 21:35:22 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-03-14 21:35:22 +0000
commit8f8adcfe381def71ee64641f249b00f3c21f4be6 (patch)
treef52b403e57e4b38372b17f5415ce23c7e0a11bf8
parentAdd documentation for MemMap::sv() (diff)
downloadlibadhocutil-8f8adcfe381def71ee64641f249b00f3c21f4be6.tar.bz2
libadhocutil-8f8adcfe381def71ee64641f249b00f3c21f4be6.tar.xz
libadhocutil-8f8adcfe381def71ee64641f249b00f3c21f4be6.zip
Only expose string_view when it's available
-rw-r--r--libadhocutil/fileUtils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libadhocutil/fileUtils.h b/libadhocutil/fileUtils.h
index 9cc73cb..f272ddd 100644
--- a/libadhocutil/fileUtils.h
+++ b/libadhocutil/fileUtils.h
@@ -151,6 +151,7 @@ namespace AdHoc {
/// The file data.
void * const data;
+#ifdef __cpp_lib_string_view
/**
* Create a std::string_view of the mapped data.
*/
@@ -159,6 +160,7 @@ namespace AdHoc {
{
return std::basic_string_view<T>((const T *)data, st.st_size / sizeof(T));
}
+#endif
private:
DLL_PUBLIC void * setupMapInt(int flags) const;