cop<KeyT,DataT,CompareT,AllocT>& cop<KeyT,DataT,CompareT,AllocT> ::keep_if(const property<value_type>& hasProperty) { iterator it = begin(), victim; while(it != end()) if ( !hasProperty(*it) ) { victim = it++; erase(victim); } else ++it; return *this; }
/* * Handle situations where the application declares an array like * * uniform vec4 myMatrix[4]; * * then calls glGetUniformLocation(..., "myMatrix") and then infer the slot * numbers rather than explicitly calling glGetUniformLocation(..., * "myMatrix[0]"), etc. */ T lookupUniformLocation(const T &key) { typename base_type::const_iterator it; it = base.upper_bound(key); if (it != base.begin()) { --it; } else { return (base[key] = key); } T t = it->second + (key - it->first); return t; }
bool operator== (const lazy_substring<T>& that) const { if (this == &that) return true; if (m_string == that.m_string) return m_start == that.m_start and m_end == that.m_end; return size() == that.size() and std::equal(begin(), end(), that.begin()); }
bool operator< (const lazy_substring<T>& that) const { if (this == &that) return false; return std::lexicographical_compare( begin() , end() , that.begin() , that.end() ); }
template <typename Iter> inline typename range_base<Iter, std::bidirectional_iterator_tag>::const_reverse_iterator range_base<Iter, std::bidirectional_iterator_tag>::rend() const { return const_reverse_iterator(begin()); }
string_type string(void) const { return string_type(begin(), end()); }