lua_json.cpp
In file included from ../../../lualib-src/lua_json.cpp:6:
../../../common/buffer.hpp: In constructor ‘moon::base_buffer::base_buffer(moon::basebuffer&&)’:
../../../common/buffer.hpp:166:26: error: ‘exchange’ is not a member of ‘std’
166 | , flag(std::exchange(other.flag, 0))
| ^~~~
../../../common/buffer.hpp:167:34: error: ‘exchange’ is not a member of ‘std’
167 | , headreserved(std::exchange(other.headreserved, 0))
| ^~~~
../../../common/buffer.hpp:168:30: error: ‘exchange’ is not a member of ‘std’
168 | , capacity(std::exchange(other.capacity, 0))
| ^~~~
../../../common/buffer.hpp:169:29: error: ‘exchange’ is not a member of ‘std’
169 | , readpos(std::exchange(other.readpos, 0))
| ^~~~
../../../common/buffer.hpp:170:30: error: ‘exchange’ is not a member of ‘std’
170 | , writepos(std::exchange(other.writepos, 0))
| ^~~~
../../../common/buffer.hpp:171:26: error: ‘exchange’ is not a member of ‘std’
171 | , data(std::exchange(other.data_, nullptr))
| ^~~~
../../../common/buffer.hpp: In member function ‘moon::base_buffer& moon::base_buffer::operator=(moon::basebuffer&&)’:
../../../common/buffer.hpp:180:30: error: ‘exchange’ is not a member of ‘std’
180 | flag = std::exchange(other.flag, 0);
| ^~~~
../../../common/buffer.hpp:181:38: error: ‘exchange’ is not a member of ‘std’
181 | headreserved = std::exchange(other.headreserved, 0);
| ^~~~
../../../common/buffer.hpp:182:34: error: ‘exchange’ is not a member of ‘std’
182 | capacity = std::exchange(other.capacity, 0);
| ^~~~
../../../common/buffer.hpp:183:33: error: ‘exchange’ is not a member of ‘std’
183 | readpos = std::exchange(other.readpos, 0);
| ^~~~
../../../common/buffer.hpp:184:34: error: ‘exchange’ is not a member of ‘std’
184 | writepos = std::exchange(other.writepos, 0); | ^~~~ ../../../common/buffer.hpp:185:30: error: ‘exchange’ is not a member of ‘std’ 185 | data = std::exchange(other.data_, nullptr); | ^~~~
make[1]: [Makefile:182: ../../obj/lualib/Debug/lua_json.o] Error 1
make: [Makefile:75: lualib] Error 2
gcc version 12.2.0 编译有报错