aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-28 13:22:50 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-28 13:22:50 -0700
commitfa98edde02bf9e587f58fd4479e415f1f352d2fd (patch)
tree7b1b4ed9084c4a7adf386e94bdf8872bcf756db9
parentae1e1af2455284999387005170bd2f1949dea7ed (diff)
downloadvcpkg-fa98edde02bf9e587f58fd4479e415f1f352d2fd.tar.gz
vcpkg-fa98edde02bf9e587f58fd4479e415f1f352d2fd.zip
[CStringView] Rename parameter, add copy ctor
-rw-r--r--toolsrc/include/CStringView.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/toolsrc/include/CStringView.h b/toolsrc/include/CStringView.h
index 3da76e63f..af8d683e7 100644
--- a/toolsrc/include/CStringView.h
+++ b/toolsrc/include/CStringView.h
@@ -8,10 +8,10 @@ namespace vcpkg
{
constexpr BasicCStringView() : cstr(nullptr) {}
constexpr BasicCStringView(const CharType* cstr) : cstr(cstr) {}
+ constexpr BasicCStringView(const BasicCStringView&) = default;
BasicCStringView(const std::basic_string<CharType>& str) : cstr(str.c_str()) {}
constexpr operator const CharType*() const { return cstr; }
-
constexpr const CharType* c_str() const { return cstr; }
private:
@@ -21,9 +21,9 @@ namespace vcpkg
using CStringView = BasicCStringView<char>;
using CWStringView = BasicCStringView<wchar_t>;
- inline const char* to_printf_arg(const CStringView spec) { return spec.c_str(); }
+ inline const char* to_printf_arg(const CStringView string_view) { return string_view.c_str(); }
- inline const wchar_t* to_wprintf_arg(const CWStringView spec) { return spec.c_str(); }
+ inline const wchar_t* to_wprintf_arg(const CWStringView string_view) { return string_view.c_str(); }
static_assert(sizeof(CStringView) == sizeof(void*), "CStringView must be a simple wrapper around char*");
static_assert(sizeof(CWStringView) == sizeof(void*), "CWStringView must be a simple wrapper around wchar_t*");