In GCC/Clang it is possible to write for forcing inlining of lambda:
auto f = [](auto & x) __attribute__((always_inline)) { ++x; };
In MSVC same can be achieved through:
auto f = [](auto & x) [[msvc::forceinline]] { ++x; };
Try online above inlining techniques.
My question is whether there exists similar syntax in GCC/CLang/MSVC for regular inlining of lambdas (not forcing), same like for regular functions there exist both inline
and __attribute__((noinline))
.
I understand that for modern compilers there is not very much difference in whether to use just inlining or forcing inlining. In both cases it is just a hint for compiler, it may or may not do actual inlining. But as I understand regular inline is a weaker hint while force inline is a stronger hint, not?
So I'm just curious if regular (non-forcing) inlining syntax exists for lambda at all or not?