[libcxx] r185968 - move __save_flags from <random> to <ios> in preparation for reuse; no functionality change
Marshall Clow
mclow.lists at gmail.com
Tue Jul 9 13:34:14 PDT 2013
Author: marshall
Date: Tue Jul 9 15:34:14 2013
New Revision: 185968
URL: http://llvm.org/viewvc/llvm-project?rev=185968&view=rev
Log:
move __save_flags from <random> to <ios> in preparation for reuse; no functionality change
Modified:
libcxx/trunk/include/ios
libcxx/trunk/include/random
Modified: libcxx/trunk/include/ios
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ios?rev=185968&r1=185967&r2=185968&view=diff
==============================================================================
--- libcxx/trunk/include/ios (original)
+++ libcxx/trunk/include/ios Tue Jul 9 15:34:14 2013
@@ -983,6 +983,33 @@ defaultfloat(ios_base& __str)
return __str;
}
+template <class _CharT, class _Traits>
+class __save_flags
+{
+ typedef basic_ios<_CharT, _Traits> __stream_type;
+ typedef typename __stream_type::fmtflags fmtflags;
+
+ __stream_type& __stream_;
+ fmtflags __fmtflags_;
+ _CharT __fill_;
+
+ __save_flags(const __save_flags&);
+ __save_flags& operator=(const __save_flags&);
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __save_flags(__stream_type& __stream)
+ : __stream_(__stream),
+ __fmtflags_(__stream.flags()),
+ __fill_(__stream.fill())
+ {}
+ _LIBCPP_INLINE_VISIBILITY
+ ~__save_flags()
+ {
+ __stream_.flags(__fmtflags_);
+ __stream_.fill(__fill_);
+ }
+};
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_IOS
Modified: libcxx/trunk/include/random
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/random?rev=185968&r1=185967&r2=185968&view=diff
==============================================================================
--- libcxx/trunk/include/random (original)
+++ libcxx/trunk/include/random Tue Jul 9 15:34:14 2013
@@ -1973,33 +1973,6 @@ linear_congruential_engine<_UIntType, __
__x_ = __c == 0 && __s == 0 ? result_type(1) : __s;
}
-template <class _CharT, class _Traits>
-class __save_flags
-{
- typedef basic_ios<_CharT, _Traits> __stream_type;
- typedef typename __stream_type::fmtflags fmtflags;
-
- __stream_type& __stream_;
- fmtflags __fmtflags_;
- _CharT __fill_;
-
- __save_flags(const __save_flags&);
- __save_flags& operator=(const __save_flags&);
-public:
- _LIBCPP_INLINE_VISIBILITY
- explicit __save_flags(__stream_type& __stream)
- : __stream_(__stream),
- __fmtflags_(__stream.flags()),
- __fill_(__stream.fill())
- {}
- _LIBCPP_INLINE_VISIBILITY
- ~__save_flags()
- {
- __stream_.flags(__fmtflags_);
- __stream_.fill(__fill_);
- }
-};
-
template <class _CharT, class _Traits,
class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
inline _LIBCPP_INLINE_VISIBILITY
More information about the cfe-commits
mailing list