An example Analysis of the default template parameters of Cnotify 11 template function
This article mainly introduces the "example analysis of the default template parameters of Category 11 template function". In daily operation, I believe that many people have doubts about the default template parameters of Cnotify 11 template function for example analysis. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts of "default template parameter example analysis of Craft 11 template function". Next, please follow the editor to study!
A classic example
This is a relatively simple feature, first borrow the sample code from C++ Primer.
In addition to the highlighted part, it is a common template comparison function. The highlight is the theme of this article: template parameters of template functions. This means that if the programmer does not specify the second template parameter, the compiler defaults to less;. If the programmer specifies another template parameter, such as greater, then the specified template parameter is used.
Observe the following code:
The first line does not specify the third template parameter, and 1