[C++ Deque] pop() return type error
2021. 7. 14. 22:32
: dq.push_back(dq.front()); 를 하거나 cout << dq.front() << "\n"; 을 하면 에러가 발생한다.
cmd에러 내용 : error: reference to type 'const std::__1::deque<int, std::__1::allocator<int=""> >::value_type' </int,>(aka 'const int') could not bind to an rvalue of type 'void'
에러 설명 : push_back() 이라는 함수는 void형을 반환하기 때문에 deque이나 cout이 pop_front에서 나온 것이 어떤 자료형인지 구분할 수 없기 때문에 발생한다.