Question 42: A C++ developer wants to explicitly specialize the template function below for the char * type:
2010-12-03 10:45
771 查看
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
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
相关文章推荐
- Question 31: A C++ developer wants to handle a static_cast() operation for the class String shown below. Which of the following
- Question 16: Which of the following methods can a developer use to override the default terminate() function in C++?
- How to separate the implementation and definition for template function in c++
- (NOT CLEAR)Question 44: What member function of std::fstream could a C++ developer invoke in order to change the target output f
- How to get a type in C++ when its template argument is the argument
- Question 33: How can a C++ developer use the placement new syntax to make new allocate an object of class SomeClass at a particu
- The method to fix "Please specify the assembly explicitly in the type name."
- Question 20: Which allocator member function do standard containers use to acquire storage for their elements in C++?
- Question 23: Which of the following C++ keywords are designed to speed up execution of a C++ function?
- Question 29: The C++ code below generates a compiler error. Which of the following solutions can be used to correctly access the
- [C++ Template]what is the type of instantiation of template function.
- 10 steps to becoming the developer everyone wants
- <Effective Mordern C++>笔记:Item 5:Prefer auto to explicit type declarations.
- ArcGIS Engine中初始化许可常见问题归纳,the application is not licensed to create or modify schema for this type of data
- How to organize the Template Files in C++
- Define the input/output port name for the Inlined C++ S-function block in Matlab Simulink
- RunningMapReduceExampleTFIDF - hadoop-clusternet - This document describes how to run the TF-IDF MapReduce example against ascii books. - This project is for those who wants to experiment hadoop as a skunkworks in a small cluster (1-10 nodes) - Google Pro
- Question 34: Under which of the following conditions will a C++ developer use polymorphism?
- The type of feed to provide for blog posts
- Item 6: Explicitly disallow the use of compiler-generated functions you do not want(Effective C++)