Код: Выделить всё
#include
int main() {
std::string src = "hello world";
const char* end = &src[5];
std::string dest(src.data(), end);
}
Код: Выделить всё
error: no matching function for call to ‘std::__cxx11::basic_string::basic_string(char*, const char*&)’
std::string dest(src.data(), end);
[... full output omitted ...]
Подробнее здесь: https://stackoverflow.com/questions/482 ... in-c14-but
Мобильная версия