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
$ g++ -std=c++17 -Wall -pedantic-errors allocator_traits_.cpp
allocator_traits_.cpp: In function ‘int main()’:
allocator_traits_.cpp:7:38: error: void value not ignored as it ought to be
7 | std::string * s = traits::construct(a, p, "hello");
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
"033-vector-implementation"に関してです。
std::string * s = traits::construct( a, p, "hello") ;
と、traits::constructの戻り値を定義していますが、c++ referenceを見るとtraits::constructの戻り値はvoidですし、
std::string *s
と定義する必要はないのではないでしょうか?The text was updated successfully, but these errors were encountered: