What is 'required from here' error

2020-03-01 10:08发布

It is in my Eclipse Problems view. The code compiles fine but there is an error saying "required from here", pointing to some boost header file and to the line state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);

I don't like to have errors or warnings. Does anybody know what that is?

2条回答
叛逆
2楼-- · 2020-03-01 10:34

This behavior is a bug of eclipse CDT Error Parser: https://bugs.eclipse.org/bugs/show_bug.cgi?id=108720 Actually this error is a warning and boost is responsible for it. You can disable this special kind of warnings to omit them.

查看更多
欢心
3楼-- · 2020-03-01 10:41

Did you actually returned? and check the types &state new_state and old_state. if you used: int new_state; and in the function compare_exchange(size_t &state, size_t new_state, size_t old_state) You get this error, well i did :)

          state_data const current_state = interlocked_compare_exchange(&state,new_state,old_state);

add:

      return new_state;
查看更多
登录 后发表回答