How to hide an implementation helper template?

后端 未结 5 2287
故里飘歌
故里飘歌 2020-12-15 05:21

Suppose that I have two template functions declared in a header file:

template  void func1(const T& value);
template          


        
5条回答
  •  甜味超标
    2020-12-15 05:50

    Two options off the top of my head:

    1. Move all the implementation to an hpp file which you include at the bottom of your h file.
    2. Refactor your code as class templates, then make the helpers private.

提交回复
热议问题