DEV Community

Discussion on: 2 ways to use static with functions in C++

Collapse
 
pgradot profile image
Pierre Gradot

Anonymous namespaces indeed have the same purpose. After may years, I still prefer static: when you see a function prototype, you immediately know that it has internal linkage. With anonymous namespaces, you have to scroll up the file to see that (or your IDE's hints, if available) to check.