[string_ref] [utility] Add string_view?
Boost has shipped string_ref since 1.53. See www.boost.org/doc/libs/1_58_0/libs/utility/doc/html/string_ref.html In the meantime, the C++ committee has shipped a final version, named string_view, in the Library Fundamentals TS. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#string.vi... In addition to the name change, the interface in the TS more closely mimics the std::basic_string interface. I'd really like to see the final TS basic_string_view added to Boost so I can start using it now. Using basic_string_ref, and then later having to rename all uses, is less attractive. I suspect others may feel the same way. Because a Boost basic_string_view would be an implementation of a standard library TS class, and because basic_string_ref is already in Boost, it seems a min-review would be sufficient rather than a formal review. So what I'm proposing here is to create a basic_string_view branch of the utility repo, and start working on basic_string_view there. Once it is reasonably compliant with the TS and Boost doc requirements we would hold a mini-review and then merge the branch to develop, and once stable, to release. Comments? --Beman
On Sun, Jul 5, 2015 at 7:34 AM, Beman Dawes
Boost has shipped string_ref since 1.53. See www.boost.org/doc/libs/1_58_0/libs/utility/doc/html/string_ref.html
In the meantime, the C++ committee has shipped a final version, named string_view, in the Library Fundamentals TS. See
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#string.vi...
In addition to the name change, the interface in the TS more closely mimics the std::basic_string interface.
I'd really like to see the final TS basic_string_view added to Boost so I can start using it now. Using basic_string_ref, and then later having to rename all uses, is less attractive. I suspect others may feel the same way.
Yes, we do! I already have people at work asking me if I know when this will be available. I think just about anyone who wants to pass strings in interfaces can make use of this somehow. The sooner, the better. Zach
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Beman Dawes Sent: 05 July 2015 13:34 To: Boost Developers List Subject: [boost] [string_ref] [utility] Add string_view?
Boost has shipped string_ref since 1.53. See www.boost.org/doc/libs/1_58_0/libs/utility/doc/html/string_ref.html
In the meantime, the C++ committee has shipped a final version, named string_view, in the Library Fundamentals TS. See http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#string.view
In addition to the name change, the interface in the TS more closely mimics the std::basic_string interface.
I'd really like to see the final TS basic_string_view added to Boost so I can start using it now. Using basic_string_ref, and then later having to rename all uses, is less attractive. I suspect others may feel the same way.
Because a Boost basic_string_view would be an implementation of a standard library TS class, and because basic_string_ref is already in Boost, it seems a min-review would be sufficient rather than a formal review. So what I'm proposing here is to create a basic_string_view branch of the utility repo, and start working on basic_string_view there. Once it is reasonably compliant with the TS and Boost doc requirements we would hold a mini-review and then merge the branch to develop, and once stable, to release.
"No standardization without implementation - or we'll throw more stuff in Boston harbour!" Go for it. Paul --- Paul A. Bristow Prizet Farmhouse Kendal UK LA8 8AB +44 (0) 1539 561830
On 7/7/2015 7:18 AM, Paul A. Bristow wrote:
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Beman Dawes Sent: 05 July 2015 13:34 To: Boost Developers List Subject: [boost] [string_ref] [utility] Add string_view?
Boost has shipped string_ref since 1.53. See www.boost.org/doc/libs/1_58_0/libs/utility/doc/html/string_ref.html
In the meantime, the C++ committee has shipped a final version, named string_view, in the Library Fundamentals TS. See http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#string.view
In addition to the name change, the interface in the TS more closely mimics the std::basic_string interface.
I'd really like to see the final TS basic_string_view added to Boost so I can start using it now. Using basic_string_ref, and then later having to rename all uses, is less attractive. I suspect others may feel the same way.
Because a Boost basic_string_view would be an implementation of a standard library TS class, and because basic_string_ref is already in Boost, it seems a min-review would be sufficient rather than a formal review. So what I'm proposing here is to create a basic_string_view branch of the utility repo, and start working on basic_string_view there. Once it is reasonably compliant with the TS and Boost doc requirements we would hold a mini-review and then merge the branch to develop, and once stable, to release.
"No standardization without implementation - or we'll throw more stuff in Boston harbour!"
We're too smart to throw good implemenTaTion away any more.
Go for it.
On Tue, Jul 7, 2015 at 7:21 AM, Edward Diener
On 7/7/2015 7:18 AM, Paul A. Bristow wrote:
-----Original Message-----
From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Beman Dawes Sent: 05 July 2015 13:34 To: Boost Developers List Subject: [boost] [string_ref] [utility] Add string_view?
Boost has shipped string_ref since 1.53. See www.boost.org/doc/libs/1_58_0/libs/utility/doc/html/string_ref.html
In the meantime, the C++ committee has shipped a final version, named string_view, in the Library Fundamentals TS. See http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#string.view
In addition to the name change, the interface in the TS more closely mimics the std::basic_string interface.
I'd really like to see the final TS basic_string_view added to Boost so I can start using it now.
use a typedef for now; and I'll update the boost implementation post 1.59 release.
-- Marshall (author of Boost.StringRef)
On 8 July 2015 at 09:43, Marshall Clow
I'd really like to see the final TS basic_string_view added to Boost so I can start using it now.
use a typedef for now; and I'll update the boost implementation post 1.59 release.
You can't use a typedef; it's a template. You can use a "using" clause, but that requires C++11 or later. -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404
On Wed, Jul 8, 2015 at 9:15 AM, Nevin Liber
On 8 July 2015 at 09:43, Marshall Clow
wrote: I'd really like to see the final TS basic_string_view added to Boost so I can start using it now.
use a typedef for now; and I'll update the boost implementation post 1.59 release.
You can't use a typedef; it's a template.
You can use a "using" clause, but that requires C++11 or later.
string_ref is a real type; it's a specialization of basic_string_ref, which
is a template.
typedef basic_string_ref
On 8 July 2015 at 11:54, Marshall Clow
On Wed, Jul 8, 2015 at 9:15 AM, Nevin Liber
wrote: On 8 July 2015 at 09:43, Marshall Clow
wrote: I'd really like to see the final TS basic_string_view added to Boost so I can start using it now.
use a typedef for now; and I'll update the boost implementation post 1.59 release.
You can't use a typedef; it's a template.
You can use a "using" clause, but that requires C++11 or later.
string_ref is a real type; it's a specialization of basic_string_ref, which is a template.
typedef basic_string_ref
string_ref;
Is the final goal to have boost::*string_view and boost::*string_ref removed? Right now, I have code that takes both std::experimental::string_view and boost::string_ref in interfaces, so the typedef doesn't change anything. I also have code that uses std::experimental::basic_string_view and boost::basic_string_ref, and the typedef doesn't work. Sure, we can add typedefs for the four concrete types, but I don't know if there really is an audience who needs that, if the interface isn't the one which matches the TS. The other downside to a typedef is that people can use string_view and string_ref interchangeably, which can lead to porting problems in the future. -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404
On Wed, Jul 8, 2015 at 10:43 AM, Marshall Clow
...
use a typedef for now; and I'll update the boost implementation post 1.59 release.
I needed the full TS interface to use the basic_string_view template in generic code, so a typedef would not be useful. I've gone ahead and implemented the rename, missing typedefs, missing or changed signatures, updated the docs, and added a new test program to probe the various changes. The existing code was left alone except fixing a few cases where something either didn't compile at all or generated warnings. I've tested under GCC and VC++ on Windows, but haven't run the tests yet on other platforms. See boostorg/utility branch string_view on GitHub. If you would like to update the boost implementation yourself, that's fine with me. But one way or another it would be very helpful if utility develop and master could be updated soon after 1.59.0 ships. Thanks, --Beman
participants (6)
-
Beman Dawes
-
Edward Diener
-
Marshall Clow
-
Nevin Liber
-
Paul A. Bristow
-
Zach Laine