As I noted in another SO question, I came across this article. The issue came up when I compiled boost 1.40 via MSVC7.1 and several C4251 warnings popped up.
Now, after reading said article, I wonder: Is it generally discouraged to export template code, e.g.
class DLLEXPORT_MACRO AClass
{
public:
std::vector<int> getVecCopy() { return myVec; }
...
}
Say this code is compiled into a DLL via MSVC7.1. Though this code does not produce any errors when referenced from other MSVC7.1 code, it is said that referencing this DLL in MSVC8 code produces crashes at runtime (memory alignment issues?).
Since this obviously is bad...what is a "best practice" to cope with the issue of exporting template code?