@@ -263,14 +263,49 @@ uri::string_type fragment(const uri &uri_) {
263
263
264
264
inline
265
265
uri::string_type hierarchical_part (const uri &uri_) {
266
- return uri::string_type (boost::begin (uri_.user_info_range ()),
267
- boost::end (uri_.path_range ()));
266
+ uri::string_type::const_iterator first, last;
267
+ uri::const_range_type user_info = uri_.user_info_range ();
268
+ uri::const_range_type host = uri_.host_range ();
269
+ uri::const_range_type port = uri_.port_range ();
270
+ uri::const_range_type path = uri_.path_range ();
271
+ if (user_info) {
272
+ first = boost::begin (user_info);
273
+ }
274
+ else {
275
+ first = boost::begin (host);
276
+ }
277
+ if (path) {
278
+ last = boost::end (path);
279
+ }
280
+ else if (port) {
281
+ last = boost::end (port);
282
+ }
283
+ else {
284
+ last = boost::end (host);
285
+ }
286
+ return uri::string_type (first, last);
268
287
}
269
288
270
289
inline
271
290
uri::string_type authority (const uri &uri_) {
272
- return uri::string_type (boost::begin (uri_.user_info_range ()),
273
- boost::end (uri_.port_range ()));
291
+ uri::string_type::const_iterator first, last;
292
+ uri::const_range_type user_info = uri_.user_info_range ();
293
+ uri::const_range_type host = uri_.host_range ();
294
+ uri::const_range_type port = uri_.port_range ();
295
+ if (user_info) {
296
+ first = boost::begin (user_info);
297
+ }
298
+ else {
299
+ first = boost::begin (host);
300
+ }
301
+
302
+ if (port) {
303
+ last = boost::end (port);
304
+ }
305
+ else {
306
+ last = boost::end (host);
307
+ }
308
+ return uri::string_type (first, last);
274
309
}
275
310
276
311
inline
0 commit comments