Why doesn't this compile:
Could there be a problem with astring
as a return type?
constexpr开发者_开发问答 std::string fnc()
{
return std::string("Yaba");
}
The constructor of std::string
that takes a pointer to char
is not constexpr
. In constexpr
functions you can only use functions that are constexpr
.
精彩评论