Reputation: 851
When implementing a standalone function inside a header file, it gives an error "Error 4 fatal error LNK1169: one or more multiply defined symbols found" whereas standalone template functions and member functions of a class work fine when implemented inside a header file.
Is the normal standalone function needed to be defined as an inline function? can anybody give me a clear explanation why?
Upvotes: 0
Views: 1273
Reputation: 10343
Every time you include it - it gets redefined into that object file
an inline function allows this because it isn't a linker object
Upvotes: 1