« first day (99 days earlier)      last day (2760 days later) » 

10:57 PM
        size_type find(basic_string_ref s) const {
            const_iterator iter = std::search ( this->cbegin (), this->cend (),
                                                s.cbegin (), s.cend (), traits::eq );
            return iter = this->cend () ? npos : std::distance ( this->cbegin (), iter );
            }

        size_type find(charT c) const {
            const_iterator iter = std::find_if ( this->cbegin (), this->cend (),
                                    detail::string_ref_traits_eq<charT, traits> ( c ));
Is line 4 a bug?
(this is inside boost::string_ref)
 
4 messages moved from Lounge<C++>
@caps that stuff is illegible
 
@caps my policy for these is that such things are always bugs
 
@sehe Well, it's more spacing than I like. I copy-pasted it from string_ref.hpp.
 
even if it's intended, the fact it makes you wonder whether it's a bug is a bug
 
@caps It's your post.
 
11:03 PM
@sehe We're on boost 1.53, which is the inaugural one for string_ref. They fixed it in the very next release.
 
size_type find(basic_string_ref s) const {
    const_iterator iter = std::search(this->cbegin(), this->cend(), s.cbegin(), s.cend(), traits::eq);
    return iter = this->cend() ? npos : std::distance(this->cbegin(), iter);
}
@caps wow. I have dodged that bullet by cribbing string_ref from boost 1.61.0 when we were still supporting boost 1.48.0
lesson learned; Keep an eye on changelogs
 
I'm not sure I can justify us using string_ref now that I know about this bug. Although it is just this one bug--I could fix our copy on SVN.
 

« first day (99 days earlier)      last day (2760 days later) »