2009-10-12から1日間の記事一覧

ちょっと待った!そのbind1stに渡す拘束値、本当に実体渡しでいいのかもう一度考えよう

C++

当然のことなのですが、自分用なのでちょっとメモ。 vector< int > va(12); fill( va.begin(), va.end() , 77 ); vector< int > vb; こういう状況があるときに、 for_each( va.begin(), va.end(), my_bind1st_ref( mem_fun1( &vector< int >::push_back ), &…

remove_modifier

C++

template< class S > struct remove_modifier { template< class T > struct remove_constref_sub{ typedef T out_type; }; template< class T > struct remove_constref_sub< const T >{ typedef T out_type; }; template< class T > struct remove_constre…