Previous 199869 Revisions Next

r45440 Thursday 3rd March, 2016 at 14:04:10 UTC by Vasantha Crabb
Implement swappable concept properly
[src/lib/util]vecstream.h

trunk/src/lib/util/vecstream.h
r253951r253952
1919
2020#include <algorithm>
2121#include <cassert>
22#include <ios>
23#include <istream>
2224#include <ostream>
25#include <memory>
26#include <ostream>
2327#include <streambuf>
2428#include <string>
2529#include <type_traits>
r253951r253952
103107
104108   void swap(basic_vectorbuf &that)
105109   {
110      using std::swap;
106111      std::basic_streambuf<CharT, Traits>::swap(that);
107      std::swap(m_mode, that.m_mode);
108      m_storage.swap(that.m_storage);
109      std::swap(m_threshold, that.m_threshold);
112      swap(m_mode, that.m_mode);
113      swap(m_storage, that.m_storage);
114      swap(m_threshold, that.m_threshold);
110115   }
111116
112117   void reserve(typename vector_type::size_type size)
r253951r253952
382387typedef basic_vectorstream<char>        vectorstream;
383388typedef basic_vectorstream<wchar_t>     wvectorstream;
384389
390template <typename CharT, typename Traits, typename Allocator>
391void swap(basic_vectorbuf<CharT, Traits, Allocator> &a, basic_vectorbuf<CharT, Traits, Allocator> &b) { a.swap(b); }
392
393template <typename CharT, typename Traits, typename Allocator>
394void swap(basic_ivectorstream<CharT, Traits, Allocator> &a, basic_ivectorstream<CharT, Traits, Allocator> &b) { a.swap(b); }
395template <typename CharT, typename Traits, typename Allocator>
396void swap(basic_ovectorstream<CharT, Traits, Allocator> &a, basic_ovectorstream<CharT, Traits, Allocator> &b) { a.swap(b); }
397template <typename CharT, typename Traits, typename Allocator>
398void swap(basic_vectorstream<CharT, Traits, Allocator> &a, basic_vectorstream<CharT, Traits, Allocator> &b) { a.swap(b); }
399
385400} // namespace util
386401
387402#endif // __MAME_UTIL_VECSTREAM_H__


Previous 199869 Revisions Next


© 1997-2024 The MAME Team