タグ

ブックマーク / nurs.hatenablog.com (1)

  • BOOST_FOREACHのパフォーマンス - nursの日記

    (boost/)foreach.hpp の、一番最後のコードの意味がわかりそうな予感がするコードを書いてみた。ようするにこういうことだ。 vector< int > iv; for( int i=0; i<10000; ++i ){ iv.push_back( i ); }// i // というコンテナがあったとしてー、BOOST_FOREACHのコードの中で、 // 実際マクロになっているのは、以下の4行にあたるような処理なのである。 if( bool cont = !0 ) for( vector< int >::iterator it=iv.begin(); it!=iv.end(); ++it ) if( cont = !0 ) for( int i= *it ; cont; cont=0 ) // 処理の中身 cout<< "hi"<< i <<endl; 実際の、(boost/

    BOOST_FOREACHのパフォーマンス - nursの日記
  • 1