Ignore:
Timestamp:
Sep 24, 2008, 2:02:16 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

BOOST_FOREACHを可能なものはVC++ 2005 for eachへ置換(やや速くなる)。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp

    r735 r750  
    9999    // 仮想関数になるメソッドに使用チェックをつける
    100100    const CClass &_class = *this;
    101     BOOST_FOREACH( const CMethod *pMethod, _class.GetDynamicMethods() )
     101    foreach( const CMethod *pMethod, _class.GetDynamicMethods() )
    102102    {
    103103        if( pMethod->IsVirtual() )
     
    108108
    109109    // インターフェイスメソッドに使用チェックをつける
    110     BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
    111     {
    112         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() )
     110    foreach( const ::Interface *pInterface, _class.GetInterfaces() )
     111    {
     112        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() )
    113113        {
    114114            pMethod->GetUserProc().Using();
     
    210210bool CClass::IsInheritsInterface( const CClass *pInterfaceClass ) const
    211211{
    212     BOOST_FOREACH( const ::Interface *pInterface, interfaces ){
     212    foreach( const ::Interface *pInterface, interfaces ){
    213213        if( pInterfaceClass == &pInterface->GetClass() ){
    214214            return true;
     
    223223    const Methods& inheritsClassMethods = inheritsClass.GetDynamicMethods();
    224224    GetDynamicMethods().reserve( inheritsClassMethods.size() );
    225     BOOST_FOREACH( const CMethod *pBaseMethod, inheritsClassMethods ){
     225    foreach( const CMethod *pBaseMethod, inheritsClassMethods ){
    226226        CMethod *pMethod = new DynamicMethod( *pBaseMethod );
    227227
     
    256256    const Interfaces& inheritsClassInterfaces = inheritsClass.GetInterfaces();
    257257    interfaces.reserve( inheritsClassInterfaces.size() );
    258     BOOST_FOREACH( const ::Interface *pInterface, inheritsClassInterfaces )
     258    foreach( const ::Interface *pInterface, inheritsClassInterfaces )
    259259    {
    260260        interfaces.push_back( new ::Interface( *pInterface ) );
     
    298298
    299299    //メソッド
    300     BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){
     300    foreach( const CMethod *pMethod, GetDynamicMethods() ){
    301301        if(  name == pMethod->GetUserProc().GetName() ){
    302302            return 1;
     
    320320
    321321    // 動的メンバ
    322     BOOST_FOREACH( const Member *pMember, dynamicMembers )
     322    foreach( const Member *pMember, dynamicMembers )
    323323    {
    324324        if( GetName() == pMember->GetName() )
     
    329329
    330330    // 静的メンバ
    331     BOOST_FOREACH( Member *pMember, staticMembers ){
     331    foreach( Member *pMember, staticMembers ){
    332332        if( GetName() == pMember->GetName() ){
    333333            return true;
     
    350350    }
    351351
    352     BOOST_FOREACH( Member *pMember, GetDynamicMembers() )
     352    foreach( Member *pMember, GetDynamicMembers() )
    353353    {
    354354        if( pMember->GetName() == memberName )
     
    366366
    367367    // インターフェイス メソッド
    368     BOOST_FOREACH( ::Interface *pInterface, GetInterfaces() )
     368    foreach( ::Interface *pInterface, GetInterfaces() )
    369369    {
    370370        pInterface->GetDynamicMethods().Enum( methodName, subs );
     
    379379    {
    380380        // インターフェイス メソッド
    381         BOOST_FOREACH( ::Interface *pInterface, GetInterfaces() )
     381        foreach( ::Interface *pInterface, GetInterfaces() )
    382382        {
    383383            result = pInterface->GetDynamicMethods().GetMethodPtr( pUserProc );
     
    446446    }
    447447
    448     BOOST_FOREACH( Member *pMember, dynamicMembers )
     448    foreach( Member *pMember, dynamicMembers )
    449449    {
    450450        const Type& memberType = pMember->GetType();
     
    553553    }
    554554
    555     BOOST_FOREACH( Member *pMember, dynamicMembers )
     555    foreach( Member *pMember, dynamicMembers )
    556556    {
    557557        // メンバサイズ
     
    654654    }
    655655
    656     BOOST_FOREACH( Member *pMember, dynamicMembers )
     656    foreach( Member *pMember, dynamicMembers )
    657657    {
    658658        int tempAlignment = pMember->GetType().GetSize();
     
    678678
    679679    vtblIndex = 0;
    680     BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){
     680    foreach( const CMethod *pMethod, GetDynamicMethods() ){
    681681        if( &pMethod->GetUserProc() == pUserProc )
    682682        {
     
    690690    }
    691691
    692     BOOST_FOREACH( const ::Interface *pInterface, interfaces )
     692    foreach( const ::Interface *pInterface, interfaces )
    693693    {
    694694        vtblMasterListIndex++;
    695695
    696696        vtblIndex = 0;
    697         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
     697        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
    698698            if( &pMethod->GetUserProc() == pUserProc )
    699699            {
     
    715715    int result = 0;
    716716
    717     BOOST_FOREACH( const ::Interface *pInterface, interfaces )
     717    foreach( const ::Interface *pInterface, interfaces )
    718718    {
    719719        result++;
     
    742742    // 未実装(abstract)の仮想関数を持つ場合はtrueを返す
    743743
    744     BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){
     744    foreach( const CMethod *pMethod, GetDynamicMethods() ){
    745745        if(pMethod->IsVirtual()){
    746746            if(pMethod->IsAbstract()){
     
    751751
    752752    // インターフェイスのvtbl
    753     BOOST_FOREACH( const ::Interface *pInterface, interfaces )
    754     {
    755         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
     753    foreach( const ::Interface *pInterface, interfaces )
     754    {
     755        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
    756756            if(pMethod->IsVirtual()){
    757757                if(pMethod->IsAbstract()){
     
    791791        pClass = classes.front();
    792792
    793         BOOST_FOREACH( const CClass *pTempClass, classes )
     793        foreach( const CClass *pTempClass, classes )
    794794        {
    795795            if( pClass->GetNamespaceScopes().size() < pTempClass->GetNamespaceScopes().size() )
     
    837837    std::string result;
    838838
    839     BOOST_FOREACH( const Member *pMember, dynamicMembers )
     839    foreach( const Member *pMember, dynamicMembers )
    840840    {
    841841        if( result.size() )
     
    853853    std::string result;
    854854
    855     BOOST_FOREACH( const Member *pMember, dynamicMembers )
     855    foreach( const Member *pMember, dynamicMembers )
    856856    {
    857857        if( result.size() )
     
    874874{
    875875    const CClass &thisClass = *this;
    876     BOOST_FOREACH( const Member *pMember, thisClass.GetDynamicMembers() )
     876    foreach( const Member *pMember, thisClass.GetDynamicMembers() )
    877877    {
    878878        if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() )
     
    935935
    936936    // 実装するインターフェイス
    937     BOOST_FOREACH( ::Interface *pInterface, interfaces )
     937    foreach( ::Interface *pInterface, interfaces )
    938938    {
    939939        pInterface->Resolve( resolver, resolveErrors );
     
    941941
    942942    // 動的メンバ
    943     BOOST_FOREACH( Member *pMember, dynamicMembers )
     943    foreach( Member *pMember, dynamicMembers )
    944944    {
    945945        pMember->Resolve( resolver, resolveErrors );
     
    947947
    948948    // 静的メンバ
    949     BOOST_FOREACH( Member *pMember, staticMembers )
     949    foreach( Member *pMember, staticMembers )
    950950    {
    951951        pMember->Resolve( resolver, resolveErrors );
     
    953953
    954954    // 動的メソッド
    955     BOOST_FOREACH( CMethod *pMethod, GetDynamicMethods() )
     955    foreach( CMethod *pMethod, GetDynamicMethods() )
    956956    {
    957957        pMethod->Resolve( resolver, resolveErrors );
     
    959959
    960960    // 静的メソッド
    961     BOOST_FOREACH( CMethod *pMethod, staticMethods )
     961    foreach( CMethod *pMethod, staticMethods )
    962962    {
    963963        pMethod->Resolve( resolver, resolveErrors );
     
    965965
    966966    // テンプレート展開後のクラス
    967     BOOST_FOREACH( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, expandedTemplateClasses )
     967    foreach( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, expandedTemplateClasses )
    968968    {
    969969        pExpandedTemplateClass->Resolve( resolver, resolveErrors );
Note: See TracChangeset for help on using the changeset viewer.