Implement LWG issue 2306: match_results::reference should be value_type&, not const value_type&. This is a general move by the LWG to have the reference type of read-only containers be a non-const reference; however, there are no methods that return a non-const reference to a match_result entry, so there's no worries about getting a non-const reference to a constant object.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202214 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2014-02-26 01:56:31 +00:00
parent d3ac046ba5
commit 103af3478e
3 changed files with 4 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ test()
typedef std::match_results<CharT*> MR;
static_assert((std::is_same<typename MR::value_type, std::sub_match<CharT*> >::value), "");
static_assert((std::is_same<typename MR::const_reference, const std::sub_match<CharT*>& >::value), "");
static_assert((std::is_same<typename MR::reference, const std::sub_match<CharT*>& >::value), "");
static_assert((std::is_same<typename MR::reference, std::sub_match<CharT*>& >::value), "");
static_assert((!std::is_same<typename MR::const_iterator, void>::value), "");
static_assert((std::is_same<typename MR::difference_type, std::ptrdiff_t>::value), "");
static_assert((std::is_same<typename MR::size_type, std::size_t>::value), "");