0

C++要点笔记(25)——默认模板类型参数

Posted by nanxiao on 一月 13, 2016 in C++要点笔记 |

C++支持“默认模板类型参数”,即不为模板提供类型参数时,则使用这个默认的参数。举例如下:

template <typename T = ProcessBase>
struct PID 
{
    ......
}

参考资料:
what’s the purpose of typename assignment inside templates

 

标签:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Copyright © 2013-2017 我的站点 All rights reserved.
This site is using the Multi Child-Theme, v2.2, on top of
the Parent-Theme Desk Mess Mirrored, v2.5, from BuyNowShop.com