Another msvc/macos fix attempt.

This commit is contained in:
Egor Pugin 2020-12-26 15:09:03 +03:00
parent f7c78f97a1
commit b2b2d02167

View File

@ -310,11 +310,13 @@ class GenericVector : public std::vector<T> {
std::function<bool(const T&, const T&)> compare_cb_; std::function<bool(const T&, const T&)> compare_cb_;
}; };
#if defined(_MSC_VER) #if defined(_MSC_VER) || defined(__APPLE__)
// msvc stl does not have ::data() in vector<bool>, // MSVC stl does not have ::data() in vector<bool>,
// so we add custom specialization // so we add custom specialization.
// On Apple there are also errors when using std::vector<bool>,
// so we replace it with vector<int> as a workaround.
template <> template <>
class GenericVector<bool> : public std::vector<bool> {}; class GenericVector<bool> : public std::vector<int> {};
#endif #endif
// The default FileReader loads the whole file into the vector of char, // The default FileReader loads the whole file into the vector of char,