| 545 | |
| 546 | template<typename CharT> |
| 547 | inline typename basic_cstring<CharT>::size_type |
| 548 | basic_cstring<CharT>::find( basic_cstring<CharT> str ) const |
| 549 | { |
| 550 | if( str.is_empty() || str.size() > size() ) |
| 551 | return static_cast<size_type>(npos); |
| 552 | |
| 553 | const_iterator it = begin(); |
| 554 | const_iterator last = end() - str.size() + 1; |
| 555 | |
| 556 | while( it != last ) { |
| 557 | if( traits_type::compare( it, str.begin(), str.size() ) == 0 ) |
| 558 | break; |
| 559 | |
| 560 | ++it; |
| 561 | } |
| 562 | |
| 563 | return it == last ? npos : static_cast<size_type>(it - begin()); |
| 564 | } |
| 565 | |
| 566 | //____________________________________________________________________________// |
| 567 |
no test coverage detected