HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
nonstd-lite
string-view-lite
C++2018–2022
nonstd-lite / string-view-lite

string-view-lite

string_view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library

2Distinct people
2Mentions
1Explicit recommenders
481GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

string_view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

Martin Moene (my favorite C++ person in the entire universe right now) wrote a drop-in replacement for older standard versions: https://github.com/martinmoene/string-view-lite.…

how_gauche used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 12:45:45 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year2 dated mentions

Observed mentions: 2018-05-10 14:28:24 UTC to 2022-01-24 11:40:20 UTC.

012018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

What Hacker News says

1 sources
Most of the author's points are well-taken. But not all of them... for example: auto plus(std::string s, std::string t) { return s + t; } > The above code is bad because it makes unnecessary copies Maybe, maybe not. A compiler may inline it (although, TBH, even regardless of parameter constness, std::string is very copy-prone in general.) > What we mean to write is: auto plus(const std::string& s, const std::string& t) Not quite. That is, this implies we don't want to take rvalues (e.g. temporary strings). It will work with rvalues, but we might be making copies for them. When you think about it, we don't even need the actual string class; we only need access to the characters. So... auto plus( std::string_view s, std::string_view t) (this is C++17; before that, try: https://github.com/martinmoene/string-view-lite ) Also, why use
Read the rest
the `auto` return type? I avoid it unless it hides some complex monstrosity, or it's a template where it's difficult to figure out. Here I would write: std::string plus( std::string_view s, std::string_view t) > In function signatures: the ugly is the bad This is... a good principle, in thoery, but in practice, not always :-) But this principle is part of why we don't want to talk about const &'s and just pass things by value if we can.
In Const all the things?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.