Last active
November 25, 2019 11:45
-
-
Save marzer/54a2d40fc144393b47c78804452a7300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//_MSC_VER: 1923 | |
//_MSC_FULL_VER: 192328107 | |
//Toolset: v142 | |
//Visual studio: 2019 16.3.10 | |
//compiler flags: /std:c++latest /permissive- | |
#include <string_view> | |
[[deprecated]] | |
constexpr std::string_view Test(const char* str, size_t len) noexcept | |
{ | |
return std::string_view{ str, len }; | |
} | |
int main() | |
{ | |
constexpr auto test1 = Test("fff", 3); //does NOT issue a deprecation warning | |
const auto test2 = Test("fff", 3); //correctly issues a deprecation warning | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment