For function and class templates, template parameters don't have to be types.
They can also be ordinary values. As with templates using type parameters, you
define code for which a certain detail remains open until the code is used.
However, the detail that is open is a value instead of a type. When using such a
template, you have to specify this value explicitly. The resulting code then
gets instantiated. This chapter illustrates this feature for a new version of
the stack class template. In addition, we show an example of nontype function
template parameters and discuss some restrictions to this technique.
-----------------------------------------------------------------
See Also:
-----------------------------------------------------------------
See Also:
-----------------------------------------------------------------
- Complete Tutorial of C++ Template's
- Standard Template Library Tutorial
- Inter Process Communication Tutorial
- Advance Programming in C & C++
-----------------------------------------------------------------
No comments:
Post a Comment