Ryonald Teofilo
Aug 31, 2023

--

ah yes of course, the compiler needs to see the definition of the inline function in every translation unit it is used. This is typically achieved by putting it in the header file. If the definition of an inline function is placed in a .cpp file, and we call it from another .cpp file, we will get a linker error :)

--

--

Ryonald Teofilo
Ryonald Teofilo

Written by Ryonald Teofilo

Sharing my thoughts on programming, one debug break at a time <ryonaldteofilo.github.io>

No responses yet