#How does the linker inline member functions?

7 messages · Page 1 of 1 (latest)

frigid mantle
#

So, if I have MyDemo.h and MyDemo.cpp, when compiling MyDemo.cpp the compiler will produce the instructions of the function demoFunc in MyDemo.o, then when compiling main.cpp the compiler will see that the call to demoFunc in main is using the correct signature, and produce a function call to that function in the assembly instructions in main.o.

So now the linker has to connect the implementation of demoFunc in MyDemo.o with the function call im main.o and SOMEHOW make it inline, instead of a real function call by putting the parameters and the return address on the stack frame. How does the linker do this?

lone ridgeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

frigid mantle
#

because, you know, all member functions of a class are implicitly inline since C++11

lilac zealot
#

I am not sure how much related this is to your question but try looking up weak symbol

#

I don't know anything about it but I heard my prof mentioning it...uh I think he was talking about templates

#

He talked about it in different context and I asked if it has to do something with inline and he said yes

lone ridgeBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.