Templates spread across multiple files

前端 未结 3 1397
孤独总比滥情好
孤独总比滥情好 2020-12-18 18:43

C++ seems to be rather grouchy when declaring templates across multiple files. More specifically, when working with templated classes, the linker expect all method definitio

3条回答
  •  心在旅途
    2020-12-18 18:56

    Across how many files? If you just want to separate class definitions from implementation then try this article in the C++ faqs. That's about the only way I know of that works at the moment, but some IDEs (Eclipse CDT for example) won't link this method properly and you may get a lot of errors. However writing your own makefiles or using Visual C++ this has always worked for me :-)

提交回复
热议问题