Does this difference in log function param matter between platforms? #5

Closed
opened 2024-06-28 10:24:10 -04:00 by maxine · 3 comments
Collaborator

Linux
void log(std::vector<token> tokens)

Windows
void log(const std::vector<token> tokens)

Linux ```void log(std::vector<token> tokens) ``` Windows ```void log(const std::vector<token> tokens)```
Owner

The platform-parity issue has been mostly "solved" by moving the bulk of the logic to shared/jlog.cpp, but it should probably be const std::vector& anyway unless it gets modified somehow.

The platform-parity issue has been mostly "solved" by moving the bulk of the logic to shared/jlog.cpp, but it should probably be const std::vector<token>& anyway unless it gets modified somehow.
Author
Collaborator

Got it. Should it be const std::vector& for only Windows or both of them? On Linux I had some issues with that trying to stop clangd's bitching.

Got it. Should it be ```const std::vector&``` for only Windows or both of them? On Linux I had some issues with that trying to stop clangd's bitching.
Owner

The interface should be const type& if it is not a primitive type (numbers etc) and it will not be modified by the function. The implementation for both platforms should match the interfaces' function signatures. Can you elaborate on the clangd complaint?

The interface should be const type& if it is not a primitive type (numbers etc) and it will not be modified by the function. The implementation for both platforms should match the interfaces' function signatures. Can you elaborate on the clangd complaint?
josh closed this issue 2024-07-01 15:32:47 -04:00
Sign in to join this conversation.
No description provided.