Opened 7 years ago

Closed 6 years ago

#11333 closed Feature Requests (fixed)

boost::basic_string_ref should interop with boost::container::basic_string

Reported by: Tavian Barnes <tavianator@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: utility
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc: Andrey.Semashev@…

Description

There is a nice implicit conversion from std::basic_string to boost::basic_string_ref. It would be nice if the same thing worked for boost::container::basic_string.

Change History (5)

comment:1 by Tavian Barnes <tavianator@…>, 6 years ago

Would be nice for the new boost::basic_string_view as well.

comment:2 by Andrey Semashev, 6 years ago

Cc: Andrey.Semashev@… added
Owner: changed from No-Maintainer to Marshall Clow

comment:3 by Andrey Semashev, 6 years ago

Owner: changed from Marshall Clow to Ion Gaztañaga

The C++17 solution to this is to add a conversion operator std::basic_string::operator std::basic_string_view(). I think, it would make sense to follow the same approach in Boost.Container. I'm adding Ion here by reassigning the ticket, let's see what he thinks.

comment:5 by Ion Gaztañaga, 6 years ago

Resolution: fixed
Status: newclosed

Interoperability to string_view added in commit:

https://github.com/boostorg/container/commit/865c69bab72e760f97c4bd073bf59bdeb5623d9d

Thanks for the report and thanks Marshall for the initial proposal.

Note: See TracTickets for help on using tickets.