Partial template specialization of free functions - best practices

后端 未结 2 1907
情歌与酒
情歌与酒 2021-02-05 17:41

As most C++ programmers should know, partial template specialization of free functions is disallowed. For example, the following is illegal C++:

template 

        
2条回答
  •  孤城傲影
    2021-02-05 18:23

    If you are writing a library to be use elsewhere or by other people do the struct/class thing. It is more code but the users of your library (possibly a future you!) will thank you. IF this is one use code, the loss of partial specialization will not hurt you.

提交回复
热议问题