I have the following code in a header only file.
#pragma once
class error_code {
public:
unsigned __int64 hi;
unsigned __int64 lo;
};
std::ostr
You can make the function static. It specifies internal linkage, so the linker won't care if the function is already defined in other translation units.
Or, as already mentioned, you can make it inline. It still has external linkage, but the standard allows external inline functions to have a definition in multiple translation units.