Skip to content

Conversation

@jason-ha
Copy link
Owner

Changes are baked though non-Windows pipelines are not validated. This PR exists for easy diff against the improved_string_width_ifdef baseline.

jason-ha added 7 commits July 31, 2019 17:07
- default to enable CPPREST_USE_STRING_VIEWS when compiler supports C++ 17

most string utility and json APIs are changed to support string_views
(deprecated APIs left alone)

primary argument replacements:
const utility::string_t& -> utility::string_view_t
const std::string& -> utility::nstring_view_t
const std::wstring& -> utility::wstring_view_t
const utf16string& -> utf16string_view

potential client fallout when enabling option:
For clients passing char* to conversion that does not require conversion, string_view will be the result. If string type is actually required then an explicit ctor would need to be added. Otherwise client may be able to use more string_view in own code and futher reduce memory copies. See searchfile.cpp in Samples for example.

Use of foo.c_str() and &foo[0] on a potential string_view is now foo.data().
- forced on for VS 2017
- forced off for VS 2015
- default for all others
+ add respect for CMAKE_CXX_STANDARD when set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants