Writing function definition in header files in C++

后端 未结 7 1534
孤城傲影
孤城傲影 2020-11-30 20:00

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:

7条回答
  •  青春惊慌失措
    2020-11-30 20:25

    1. If your functions are that simple, make them inline, and you'll have to stick them in the header file anyway. Other than that, any conventions are just that - conventions.

    2. Yes, the compiler does expand the header file where it encounters the #include statements.

提交回复
热议问题