hide function template, declare specializations

后端 未结 4 1110
眼角桃花
眼角桃花 2021-01-22 17:46

This is a followup to C++ templates: prevent instantiation of base template

I use templates to achieve function overloading without the mess of implicit type conversions

4条回答
  •  孤独总比滥情好
    2021-01-22 18:28

    When compiling main.cpp, there's no way for the compiler to know which template specializations may exist in some other compilation unit -- so there's no way to flag this error at compile time, you have to wait until link time.

提交回复
热议问题