<分区>
我在 Linux 上,并尝试编写跨平台代码。我知道在 Windows 上很难正确使用模板,但我不记得具体情况了。
我确实知道有一个问题与模板调试和跨 dll 边界的模板有关,但不知道如何解决它——或者是否有可能的解决方法。
我相信还有其他问题,但我只找到了对它们的模糊引用。
那么:Windows 上的 C++ 模板有哪些问题?除了不使用模板,还有什么解决办法?
编辑:也许问题只出在 STL
上,而不是一般模板上?
两个引号:
You cannot expose STL calls across library boundaries on windows without significant headaches.
和
Encapsulation is a must, I have done some projects with stl containers over dll boundaries as well as static libraries on windows and it's not possible to use without encapsulation.