Changeset 736 in dev for trunk/ab5.0/abdev/ab_common/src/Lexical/Namespace.cpp
- Timestamp:
- Aug 25, 2008, 5:38:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Lexical/Namespace.cpp
r700 r736 1 1 #include "stdafx.h" 2 2 #include <algorithm> 3 3 4 4 using namespace ActiveBasic::Common::Lexical; … … 28 28 NamespaceScopes NamespaceScopes::operator+ ( const NamespaceScopes &namespaceScopes ) const 29 29 { 30 NamespaceScopes result = *this; 31 BOOST_FOREACH( const std::string &name, namespaceScopes ) 32 { 33 result.push_back( name ); 34 } 30 NamespaceScopes result; 31 result.reserve( this->size() + namespaceScopes.size() ); 32 result = *this; 33 result.append( namespaceScopes ); 35 34 return result; 36 35 } … … 42 41 return false; 43 42 } 44 45 for( int i=static_cast<int>(this->size()-1); i>=0; i-- ) 46 { 47 if( (*this)[i] != namespaceScopes[i] ) 48 { 49 return false; 50 } 51 } 52 53 return true; 43 return std::equal(begin(), end(), namespaceScopes.begin() ); 54 44 } 55 45
Note:
See TracChangeset
for help on using the changeset viewer.