Add another test case to the deduction guide for basic_string.
llvm-svn: 325740
This commit is contained in:
parent
e54a9ee8ac
commit
3c83937370
|
@ -39,6 +39,17 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
const char* s = "12345678901234";
|
||||
std::basic_string s1(s, s+10); // Can't use {} here
|
||||
using S = decltype(s1); // what type did we get?
|
||||
static_assert(std::is_same_v<S::value_type, char>, "");
|
||||
static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, "");
|
||||
static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, "");
|
||||
assert(s1.size() == 10);
|
||||
assert(s1.compare(0, s1.size(), s, s1.size()) == 0);
|
||||
}
|
||||
|
||||
{
|
||||
const char* s = "12345678901234";
|
||||
std::basic_string s1{s, s+10, std::allocator<char>{}};
|
||||
|
|
Loading…
Reference in New Issue