mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
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:
@@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user