If byteSwap is NOT a template function, Cppcheck seems to understand it and we don't have the false positive.
If byteswap is a template, but we don't use std::ranges::transform (so, just call it directly). It also works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We seem to be having a false positive unusedFunction.
style: The function 'byteSwap' is never used. [unusedFunction]
I simplified the code somewhat:
If byteSwap is NOT a template function, Cppcheck seems to understand it and we don't have the false positive.
If byteswap is a template, but we don't use std::ranges::transform (so, just call it directly). It also works.
Thanks! I have created https://trac.cppcheck.net/ticket/12599