[libcxx-commits] [libcxx] 9a31780 - [libc++] Modernizes the forwarded ios headers.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun May 7 03:28:58 PDT 2023
Author: Mark de Wever
Date: 2023-05-07T12:28:52+02:00
New Revision: 9a317802efe9a6d8f86ba098c7fa8d182c2c0285
URL: https://github.com/llvm/llvm-project/commit/9a317802efe9a6d8f86ba098c7fa8d182c2c0285
DIFF: https://github.com/llvm/llvm-project/commit/9a317802efe9a6d8f86ba098c7fa8d182c2c0285.diff
LOG: [libc++] Modernizes the forwarded ios headers.
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D150030
Added:
Modified:
libcxx/include/__fwd/fstream.h
libcxx/include/__fwd/ios.h
libcxx/include/__fwd/istream.h
libcxx/include/__fwd/ostream.h
libcxx/include/__fwd/sstream.h
libcxx/include/__fwd/streambuf.h
Removed:
################################################################################
diff --git a/libcxx/include/__fwd/fstream.h b/libcxx/include/__fwd/fstream.h
index 0eed60a42c2b4..b4a112bfd4de6 100644
--- a/libcxx/include/__fwd/fstream.h
+++ b/libcxx/include/__fwd/fstream.h
@@ -27,16 +27,16 @@ class _LIBCPP_TEMPLATE_VIS basic_ofstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_fstream;
-typedef basic_filebuf<char> filebuf;
-typedef basic_ifstream<char> ifstream;
-typedef basic_ofstream<char> ofstream;
-typedef basic_fstream<char> fstream;
+using filebuf = basic_filebuf<char>;
+using ifstream = basic_ifstream<char>;
+using ofstream = basic_ofstream<char>;
+using fstream = basic_fstream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_filebuf<wchar_t> wfilebuf;
-typedef basic_ifstream<wchar_t> wifstream;
-typedef basic_ofstream<wchar_t> wofstream;
-typedef basic_fstream<wchar_t> wfstream;
+using wfilebuf = basic_filebuf<wchar_t>;
+using wifstream = basic_ifstream<wchar_t>;
+using wofstream = basic_ofstream<wchar_t>;
+using wfstream = basic_fstream<wchar_t>;
#endif
template <class _CharT, class _Traits>
diff --git a/libcxx/include/__fwd/ios.h b/libcxx/include/__fwd/ios.h
index e2512471e9729..82c865d58cc75 100644
--- a/libcxx/include/__fwd/ios.h
+++ b/libcxx/include/__fwd/ios.h
@@ -21,9 +21,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_ios;
-typedef basic_ios<char> ios;
+using ios = basic_ios<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_ios<wchar_t> wios;
+using wios = basic_ios<wchar_t>;
#endif
template <class _CharT, class _Traits>
@@ -31,9 +31,9 @@ class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_N
#if defined(_NEWLIB_VERSION)
// On newlib, off_t is 'long int'
-typedef long int streamoff; // for char_traits in <string>
+using streamoff = long int; // for char_traits in <string>
#else
-typedef long long streamoff; // for char_traits in <string>
+using streamoff = long long; // for char_traits in <string>
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__fwd/istream.h b/libcxx/include/__fwd/istream.h
index 5172da095ece1..a06907a6c8ef9 100644
--- a/libcxx/include/__fwd/istream.h
+++ b/libcxx/include/__fwd/istream.h
@@ -24,12 +24,12 @@ class _LIBCPP_TEMPLATE_VIS basic_istream;
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_iostream;
-typedef basic_istream<char> istream;
-typedef basic_iostream<char> iostream;
+using istream = basic_istream<char>;
+using iostream = basic_iostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_istream<wchar_t> wistream;
-typedef basic_iostream<wchar_t> wiostream;
+using wistream = basic_istream<wchar_t>;
+using wiostream = basic_iostream<wchar_t>;
#endif
template <class _CharT, class _Traits>
diff --git a/libcxx/include/__fwd/ostream.h b/libcxx/include/__fwd/ostream.h
index 5a6a01f3b8341..3347e0f71d7a1 100644
--- a/libcxx/include/__fwd/ostream.h
+++ b/libcxx/include/__fwd/ostream.h
@@ -21,10 +21,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_ostream;
-typedef basic_ostream<char> ostream;
+using ostream = basic_ostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_ostream<wchar_t> wostream;
+using wostream = basic_ostream<wchar_t>;
#endif
template <class _CharT, class _Traits>
diff --git a/libcxx/include/__fwd/sstream.h b/libcxx/include/__fwd/sstream.h
index 83e82bf8a272a..e2d46fbe1d9bb 100644
--- a/libcxx/include/__fwd/sstream.h
+++ b/libcxx/include/__fwd/sstream.h
@@ -28,16 +28,16 @@ class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_stringstream;
-typedef basic_stringbuf<char> stringbuf;
-typedef basic_istringstream<char> istringstream;
-typedef basic_ostringstream<char> ostringstream;
-typedef basic_stringstream<char> stringstream;
+using stringbuf = basic_stringbuf<char>;
+using istringstream = basic_istringstream<char>;
+using ostringstream = basic_ostringstream<char>;
+using stringstream = basic_stringstream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_stringbuf<wchar_t> wstringbuf;
-typedef basic_istringstream<wchar_t> wistringstream;
-typedef basic_ostringstream<wchar_t> wostringstream;
-typedef basic_stringstream<wchar_t> wstringstream;
+using wstringbuf = basic_stringbuf<wchar_t>;
+using wistringstream = basic_istringstream<wchar_t>;
+using wostringstream = basic_ostringstream<wchar_t>;
+using wstringstream = basic_stringstream<wchar_t>;
#endif
template <class _CharT, class _Traits, class _Allocator>
diff --git a/libcxx/include/__fwd/streambuf.h b/libcxx/include/__fwd/streambuf.h
index f1ee9115ed247..b35afa6afe343 100644
--- a/libcxx/include/__fwd/streambuf.h
+++ b/libcxx/include/__fwd/streambuf.h
@@ -21,10 +21,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_streambuf;
-typedef basic_streambuf<char> streambuf;
+using streambuf = basic_streambuf<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-typedef basic_streambuf<wchar_t> wstreambuf;
+using wstreambuf = basic_streambuf<wchar_t>;
#endif
template <class _CharT, class _Traits>
More information about the libcxx-commits
mailing list