Project

General

Profile

Feature #7943

std::string_view support

Added by Rathnadhar K V 7 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12/23/2020
Due date:
% Done:

0%

Estimated time:

Description

Namaskara,

There are many functions in wt (4.0) which take std::string as function argument.
In many cases we create an immutable (const) string what we pass function argument (s).

In cases where feasible, can we have a std::string_view overloaded functions, so that we create a const string_view object that we provide these functions as input argument.

Regards
Rathnadhar K V

#1

Updated by Samir Shaker 5 months ago

I would also like to see support for std::string_view. In addition to what Rathnadhar mentioned, WLogger fails to output an std::string_view. For example, the code below gives an error:

std::string_view my_string("a string literal");
log("info") << my_string;

The error in my case was:

/usr/local/include/Wt/WLogger.h:370:23: error: no matching function for call to 'to_string'
      impl_->line_ << to_string(t);

Samir.

Also available in: Atom PDF