Fix "cannot bind non-const lvalue reference of type ‘ImVec4&’ to an rvalue of type ‘ImVec4’" compilation error#2
Conversation
|
The best would have been to use But yeah, I made this a while ago when I just started to use C++, hence why there is a lot of bad code and style. (and using the |
da17ecf to
d5632b5
Compare
…value of type ‘ImVec4’" compilation error
This patch fixes the following compilation error on GCC 12:
```
wkbre/wkbre.cpp: In function ‘bool IGPlayerChooser(char*, goref*)’:
wkbre/wkbre.cpp:2404:41: error: cannot bind non-const lvalue reference of type ‘ImVec4&’ to an rvalue of type ‘ImVec4’
2404 | OldColorButton("color", ImVec4(1, 1, 1, 1));
| ^~~~~~~~~~~~~~~~~~
wkbre/wkbre.cpp:1900:47: note: initializing argument 2 of ‘bool OldColorButton(const char*, ImVec4&, bool)’
1900 | bool OldColorButton(const char *desc, ImVec4 &col, bool mini = false)
| ~~~~~~~~^~~
```
by specifying the proper data type for the `col` parameter of the OldColorButton funtion.
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
d5632b5 to
46ae0dc
Compare
Thanks for the guidance, I've updated the branch to include the proper code fix, please review. |
This patch fixes the following compilation error on GCC 12 of the MinGW-w64 toolchain:
as the pass-by-reference syntax doesn't seem to be necessary. I have little to no C++/Dear ImGui experience so feel free to close this if it's not the case.