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:
parent
d3ac046ba5
commit
103af3478e
@ -437,7 +437,7 @@ class match_results
|
|||||||
public:
|
public:
|
||||||
typedef sub_match<BidirectionalIterator> value_type;
|
typedef sub_match<BidirectionalIterator> value_type;
|
||||||
typedef const value_type& const_reference;
|
typedef const value_type& const_reference;
|
||||||
typedef const_reference reference;
|
typedef value_type& reference;
|
||||||
typedef /implementation-defined/ const_iterator;
|
typedef /implementation-defined/ const_iterator;
|
||||||
typedef const_iterator iterator;
|
typedef const_iterator iterator;
|
||||||
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
||||||
@ -5263,7 +5263,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
_BidirectionalIterator __position_start_;
|
_BidirectionalIterator __position_start_;
|
||||||
typedef const value_type& const_reference;
|
typedef const value_type& const_reference;
|
||||||
typedef const_reference reference;
|
typedef value_type& reference;
|
||||||
typedef typename __container_type::const_iterator const_iterator;
|
typedef typename __container_type::const_iterator const_iterator;
|
||||||
typedef const_iterator iterator;
|
typedef const_iterator iterator;
|
||||||
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
|
typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
|
||||||
|
@ -35,7 +35,7 @@ test()
|
|||||||
typedef std::match_results<CharT*> MR;
|
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::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::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::const_iterator, void>::value), "");
|
||||||
static_assert((std::is_same<typename MR::difference_type, std::ptrdiff_t>::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), "");
|
static_assert((std::is_same<typename MR::size_type, std::size_t>::value), "");
|
||||||
|
@ -242,7 +242,7 @@
|
|||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2293">2293</a></td><td>Wrong facet used by num_put::do_put</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2293">2293</a></td><td>Wrong facet used by num_put::do_put</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2301">2301</a></td><td>Why is std::tie not constexpr?</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2301">2301</a></td><td>Why is std::tie not constexpr?</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304">2304</a></td><td>Complexity of count in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304">2304</a></td><td>Complexity of count in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2306">2306</a></td><td>match_results::reference should be value_type&, not const value_type&</td><td>Issaquah</td><td></td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2306">2306</a></td><td>match_results::reference should be value_type&, not const value_type&</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2308">2308</a></td><td>Clarify container destructor requirements w.r.t. std::array</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2308">2308</a></td><td>Clarify container destructor requirements w.r.t. std::array</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313">2313</a></td><td>tuple_size should always derive from integral_constant<size_t, N></td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313">2313</a></td><td>tuple_size should always derive from integral_constant<size_t, N></td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2314">2314</a></td><td>apply() should return decltype(auto) and use decay_t before tuple_size</td><td>Issaquah</td><td></td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2314">2314</a></td><td>apply() should return decltype(auto) and use decay_t before tuple_size</td><td>Issaquah</td><td></td></tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user