- 博客(2)
- 资源 (8)
- 收藏
- 关注
原创 仿函数与if算法
<br />struct SMyData { int m_nData; int m_nData2; }; //使用STL中带有if的算法,可以传入自定义条件,当符合条件时进行当前算法的操作。 struct sfind_function { sfind_function(){ cout<<"Init 1"<<endl;}; bool operator () (SMyData& aData) { return aData.m_nData==6; //设当为6
2010-11-13 18:57:00 639
原创 ptr_fun mem_fun_ref mem_fun bind1st bind2nd
////////////////////////////////////////////////////////////////////////// //ptr_fun mem_fun_ref mem_fun //STL 算法函数有些要传入仿函数,例如remove_if()的第三个参数。 //许多情况下直接传入一个全局指针函数是不会报错的,有时则不然,例如:bind2nd(),这时需要使用ptr_fun; //当一个函数指针是类成员函数时,编译将不能通过。此时将使用到了mem_fun和me
2010-11-13 16:42:00 1914 1
Horizon-Based Indirect Lighting (HBIL)
2018-08-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人