I have a class which has many small functions. By small functions, I mean functions that doesn't do any processing but just return a literal value. Something like:
string Foo::method() const{
return "A";
}
I have created a header file "Foo.h" and source file "Foo.cpp". But since the function is very small, I am thinking about putting it in the header file itself. I have the following questions:
- Is there any performance or other issues if I put these function definition in header file? I will have many functions like this.
- My understanding is when the compilation is done, compiler will expand the header file and place it where it is included. Is that correct?