| 496 | |
| 497 | template<typename CharT> |
| 498 | inline typename basic_cstring<CharT>::size_type |
| 499 | basic_cstring<CharT>::find( basic_cstring<CharT> str ) const |
| 500 | { |
| 501 | if( str.is_empty() || str.size() > size() ) |
| 502 | return static_cast<size_type>(npos); |
| 503 | |
| 504 | const_iterator it = begin(); |
| 505 | const_iterator last = end() - str.size() + 1; |
| 506 | |
| 507 | while( it != last ) { |
| 508 | if( traits_type::compare( it, str.begin(), str.size() ) == 0 ) |
| 509 | break; |
| 510 | |
| 511 | ++it; |
| 512 | } |
| 513 | |
| 514 | return it == last ? npos : static_cast<size_type>(it - begin()); |
| 515 | } |
| 516 | |
| 517 | //____________________________________________________________________________// |
| 518 |
no test coverage detected