4
이 코드가 컴파일되지 않는 이유는 무엇입니까? 나는 그것이 잘 작동 noncopyable의 또 다른 유형 std::stringstream
를 교체 할 경우rvalue std :: stringstream을 값으로 함수에 전달할 수없는 이유는 무엇입니까?
error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&)’
f(std::stringstream{});
^
:
#include <sstream>
void f(std::stringstream) { }
int main() {
f(std::stringstream{});
}
나는이 오류가 발생합니다. 이것은 stringstream
의 생성자를 사용해서는 안됩니까?
MacOS에서 clang-500.2.79 및 -std = C++ 11을 사용하면 코드가 컴파일됩니다. 어떤 컴파일러와 표준 라이브러리를 사용하고 있습니까? – razeh
표준 라이브러리 구현이 불완전한 것 같습니다. –
@razeh 데비안 테스트에서 GCC 4.8.2와 clang 4.2.1을 사용하고 있는데, stdlib을 어떻게 사용하는지 알지 못합니다. – uk4321