File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ size() const noexcept
180180inline
181181std::string
182182segments_base::
183- front () const noexcept
183+ front () const
184184{
185185 BOOST_ASSERT (! empty ());
186186 return *begin ();
@@ -189,7 +189,7 @@ front() const noexcept
189189inline
190190std::string
191191segments_base::
192- back () const noexcept
192+ back () const
193193{
194194 BOOST_ASSERT (! empty ());
195195 return *--end ();
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ class BOOST_SYMBOL_VISIBLE segments_base
244244 @return The first segment.
245245 */
246246 std::string
247- front () const noexcept ;
247+ front () const ;
248248
249249 /* * Return the last segment
250250
@@ -277,7 +277,7 @@ class BOOST_SYMBOL_VISIBLE segments_base
277277 @return The last segment.
278278 */
279279 std::string
280- back () const noexcept ;
280+ back () const ;
281281
282282 /* * Return an iterator to the beginning
283283
Original file line number Diff line number Diff line change @@ -273,11 +273,30 @@ struct segments_base_test
273273 }
274274 }
275275
276+ void
277+ testFrontBackNonEmpty ()
278+ {
279+ // front()/back() on single-element segments
280+ // (noexcept removal regression)
281+ {
282+ auto rv = parse_uri_reference (" /only" );
283+ BOOST_TEST (rv.has_value ());
284+ if (rv.has_value ())
285+ {
286+ segments_base const & ps (
287+ segments_view (rv->encoded_segments ()));
288+ BOOST_TEST_EQ (ps.front (), " only" );
289+ BOOST_TEST_EQ (ps.back (), " only" );
290+ }
291+ }
292+ }
293+
276294 void
277295 run ()
278296 {
279297 testObservers ();
280298 testRange ();
299+ testFrontBackNonEmpty ();
281300 testJavadoc ();
282301 }
283302};
You can’t perform that action at this time.
0 commit comments