Questions tagged [string-span]
4 questions
8
votes
3 answers
Why string_view constructor doesn't take a pair of iterators
Both string_ref in boost and string_span in GSL doesn't define constructor that takes a pair of iterator. What is the reason of this decision ?
Usually it's not a big deal, I can just create string_ref like this :
boost::string_ref s(start,…

Kamil Zubair
- 229
- 2
- 10
6
votes
1 answer
How do gsl::string_span and std::string_view differ?
From what I can gather, gsl::string_span and std::string_view seem to have essentially the same rationale for use. Is that indeed the case? If so, are they effectively identical? If not - how do they differ?
Related question: What purpose does…

einpoklum
- 118,144
- 57
- 340
- 684
4
votes
3 answers
boost::any_range> crash in Release mode
I'm observing a rather weird behaviour of the following piece of code:
#include
#include
#include
#include
#include
#include "gsl.h"
template

Rostislav
- 3,857
- 18
- 30
2
votes
2 answers
Using gsl::zstring_view with C APIs
I'm trying to use modern string-handling approaches (like std::string_view or GSL's string_span) to interact with a C API (DBus) that takes strings as null-terminated const char*s, e.g.
DBusMessage* dbus_message_new_method_call(
const char*…

Matt Kline
- 10,149
- 7
- 50
- 87