正在加载图片...
Using function overloading, note how similar each of the swap functions would be The three places where the type is specified What if we passed the type somehow? Templates make this possible Declare functions that receive both data and types via parameter Thus code becomes more generic Easier to reuse and extend to other types COMP 152▪ Using function overloading, note how similar each of the swap functions would be • The three places where the type is specified ▪ What if we passed the type somehow? ▪ Templates make this possible • Declare functions that receive both data and types via parameter ▪ Thus code becomes more generic • Easier to reuse and extend to other types COMP152 7
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有