Implement std::string_view as described in http://wg21.link/P0254R1. Reviewed as https://reviews.llvm.org/D21459

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276238 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2016-07-21 05:31:24 +00:00
parent f50841f3ac
commit 1e00d6db31
100 changed files with 19172 additions and 731 deletions

View File

@@ -31,7 +31,7 @@ int sign(int x)
template <class S>
void
test(const S& s, typename S::size_type pos1, typename S::size_type n1,
test(const S& s, typename S::size_type pos1, typename S::size_type n1,
const S& str, typename S::size_type pos2, typename S::size_type n2, int x)
{
try
@@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
assert(pos1 <= s.size());
assert(pos2 <= str.size());
}
catch (std::out_of_range&)
catch (const std::out_of_range&)
{
assert(pos1 > s.size() || pos2 > str.size());
}
@@ -48,8 +48,8 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
template <class S>
void
test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
const S& str, typename S::size_type pos2, int x)
test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
const S& str, typename S::size_type pos2, int x)
{
try
{
@@ -57,7 +57,7 @@ test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
assert(pos1 <= s.size());
assert(pos2 <= str.size());
}
catch (std::out_of_range&)
catch (const std::out_of_range&)
{
assert(pos1 > s.size() || pos2 > str.size());
}