diff options
author | Jose <jose@zeroc.com> | 2012-08-10 23:53:37 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-10 23:53:37 +0200 |
commit | 1d5c04bb8c0e786a717e36467e17f34bcc4f1d95 (patch) | |
tree | c1c91f034589260e97033131061d536ecfc2b9cb /cpp/include/Ice/StreamTraits.h | |
parent | ICE-4702 - Poor hash algorithm (diff) | |
download | ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.tar.bz2 ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.tar.xz ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.zip |
C++11 ami lambda support
Diffstat (limited to 'cpp/include/Ice/StreamTraits.h')
-rw-r--r-- | cpp/include/Ice/StreamTraits.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/include/Ice/StreamTraits.h b/cpp/include/Ice/StreamTraits.h index 9f37834d8cf..97638d5152b 100644 --- a/cpp/include/Ice/StreamTraits.h +++ b/cpp/include/Ice/StreamTraits.h @@ -402,6 +402,28 @@ struct StreamHelper<std::pair<T, T>, StreamTraitTypeSequence> } }; +template<> +struct StreamHelper<std::pair< ::std::vector<bool>::const_iterator, + ::std::vector<bool>::const_iterator>, StreamTraitTypeSequence> +{ + template<class S> static inline void + write(S* stream, const std::pair< ::std::vector<bool>::const_iterator, + ::std::vector<bool>::const_iterator>& v) + { + stream->writeSize(static_cast< ::Ice::Int>(IceUtilInternal::distance(v.first, v.second))); + for(::std::vector<bool>::const_iterator p = v.first; p != v.second; ++p) + { + stream->write(static_cast<bool>(*p)); + } + } + + template<class S> static inline void + read(S* stream, std::pair< ::std::vector<bool>::const_iterator, ::std::vector<bool>::const_iterator>&) + { + assert(false); // Only used for marshaling. + } +}; + // Helper for zero-copy array sequence parameters template<typename T> struct StreamHelper<std::pair<IceUtil::ScopedArray<T>, std::pair<const T*, const T*> >, StreamTraitTypeSequence> |