inline function linker error

前端 未结 5 1846
面向向阳花
面向向阳花 2020-12-08 02:47

I am trying to use inline member functions of a particular class. For example the function declaration and implementation without inlining is as such:

in the header

5条回答
  •  醉酒成梦
    2020-12-08 03:19

    from C++ FAQ Lite

    If you put the inline function's definition into a .cpp file, and if it is called from some other .cpp file, you'll get an "unresolved external" error from the linker.

    How do you tell the compiler to make a member function inline?

提交回复
热议问题