You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
why i can define :
const std::string& s1 = "test";
or
const std::string s1 = "test";
but if i try to define s1 with constexpr, my VS2019 report error
constexpr std::string& s1 ="test'; (due to constexpr only can define reference , pointer, or literal values, so i define string&.
i am confused, why const define pass, but constexpr will fail ?
The text was updated successfully, but these errors were encountered:
why i can define :
const std::string& s1 = "test";
or
const std::string s1 = "test";
but if i try to define s1 with constexpr, my VS2019 report error
constexpr std::string& s1 ="test'; (due to constexpr only can define reference , pointer, or literal values, so i define string&.
i am confused, why const define pass, but constexpr will fail ?
The text was updated successfully, but these errors were encountered: