Do static template functions need?

I often declare utility functions in my source files as staticbeing connected internally. Now I have a header file with many template functions (in a named namespace). Should I make them static in order to avoid binding errors or that the template functions behave differently?

+4
source share
1 answer

Template functions are implicit inline(note: not their explicit specialization (s)). This way you will not have a linker error related to multiple definitions of the same function. In fact, it is inlinenow mostly perceived as a linker directive, preventing ODR violations .

Justification

, ODR .

, , : , , .

, , , . , , !

static

static: , , : , .

( ), static : , .

+7

All Articles