diff options
Diffstat (limited to 'cpp/include/Ice/Stream.h')
-rw-r--r-- | cpp/include/Ice/Stream.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cpp/include/Ice/Stream.h b/cpp/include/Ice/Stream.h index 6ec33c5e2e1..3257def6c6a 100644 --- a/cpp/include/Ice/Stream.h +++ b/cpp/include/Ice/Stream.h @@ -331,7 +331,24 @@ public: virtual void write(const Float*, const Float*) = 0; virtual void write(const Double*, const Double*) = 0; - virtual void writeOptional(Int, OptionalType) = 0; + virtual void writeOptional(Int, OptionalType) = 0; + +// +// COMPILER FIX: clang using libc++ cannot use the StreamHelper to write +// vector<bool>, as vector<bool> get optimized to +// __bit_const_reference that has not size member function. +// +#if defined(__clang__) && defined(_LIBCPP_VERSION) + virtual void write(const ::std::vector<bool>& v) + { + writeSize(static_cast<Int>(v.size())); + for(::std::vector<bool>::const_iterator p = v.begin(); p != v.end(); ++p) + { + bool v = (*p); + write(v); + } + } +#endif template<typename T> inline void write(const T& v) { |