3 ms·
MSVC treats inline as a hint [0] , GCC is ambiguous [1] but I read it as utilising the hint. My understanding of clang [2] is that it tries to match GCC, which
by maccard 3y ago
MSVC treats inline as a hint [0] , GCC is ambiguous [1] but I read it as utilising the hint. My understanding of clang [2] is that it tries to match GCC, which would imply that it applies.
[0] https://learn.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion?view=msvc-170 https://learn.microsoft.com/en-us/cpp/build/reference/ob-inl...
[1] https://gcc.gnu.org/onlinedocs/gcc/Inline.html https://gcc.gnu.org/onlinedocs/gcc/Inline.html
[2] https://clang.llvm.org/compatibility.html https://clang.llvm.org/compatibility.html
- rileymat2 3y agoWhat the OP is saying is that it has a use to satisfy (https://en.cppreference.com/w/cpp/language/definition https://en.cppreference.com/w/cpp/language/definition) and in that case it is not optional and not ignored by the compiler. Whether it will "actually" inline it is another matter, that is optional.