Question 42: A C++ developer wants to explicitly specialize the template function below for the char * type:

来源:互联网 发布:太平洋软件下载中心 编辑:程序博客网 时间:2024/06/03 18:37

template <class T> void fn(T a){...}

 

Which of the following methods can the developer use to carry out this specialization?

 

    A. void fn<char*>(char* a){...}

    B. template <> void fn<char*>(char* a){...}

    C. void fn<char*>(T a){...}

    D. template <class T> void fn(char* a){...}

    E. template <class T> void fn<char*>(T a){...}

B

原创粉丝点击