[libc++] [P0935] [C++20] Eradicating unnecessarily explicit default constructors from the standard library.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D91292
This commit is contained in:
@@ -11,12 +11,17 @@
|
||||
// template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
|
||||
// class basic_stringbuf
|
||||
|
||||
// explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out);
|
||||
// explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); // before C++20
|
||||
// basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20
|
||||
// explicit basic_stringbuf(ios_base::openmode which); // C++20
|
||||
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#if TEST_STD_VER >= 11
|
||||
#include "test_convertible.h"
|
||||
#endif
|
||||
|
||||
template<typename CharT>
|
||||
struct testbuf
|
||||
@@ -52,5 +57,13 @@ int main(int, char**)
|
||||
buf.check();
|
||||
}
|
||||
|
||||
return 0;
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::stringbuf B;
|
||||
static_assert(test_convertible<B>(), "");
|
||||
static_assert(!test_convertible<B, std::ios_base::openmode>(), "");
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user