示例#1
0
 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;
 }
示例#2
0
 /*
  * 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;
 }
示例#3
0
    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());
    }
示例#4
0
    bool operator< (const lazy_substring<T>& that) const
    {
      if (this == &that)
        return false;

      return std::lexicographical_compare(
        begin()
        , end()
        , that.begin()
        , that.end()
      );
    }
示例#5
0
文件: range.hpp 项目: highpower/fcgid
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());
}
示例#6
0
 string_type string(void) const
   { return string_type(begin(), end()); }