示例#1
0
template<> inline void BCP_vec<char>::push_back(const_reference x)
{
	if (finish != end_of_storage)
		*finish++ = x;
	else
		insert_aux(finish, x);
}
示例#2
0
//------------------------------------------------------------------------------
template<> inline BCP_vec<char>::iterator
BCP_vec<char>::insert(iterator position, const_reference x)
{
	const size_t n = position - start;
	if (finish != end_of_storage && position == finish) {
		*finish++ = x;
	} else
		insert_aux(position, x);
	return start + n;
}
示例#3
0
	void insert(
		const vector_type& min,
		const vector_type& max,
		const T& x )
	{
		//aabb_node* n = new aabb_node;
		aabb_node* n = create_node();
		n->min = min;
		n->max = max;
		n->car = NULL;
		n->cdr = NULL;
		n->user = x;
		if( !root_ )  { root_ = n; return; }
		insert_aux( &root_, n );
	}
示例#4
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::assign_aux(InputIterator first, InputIterator last, std::false_type)  
{  
    destroy(begin(), end());  
    deallocate(begin(), end());  
    insert_aux(end(), first, last, std::false_type());  
}  
示例#5
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::assign_aux(size_type count, const T& value, std::true_type)  
{  
    destroy(begin(), end());  
    deallocate(begin(), end());  
    insert_aux(end(), count, value, std::true_type());  
}  
示例#6
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::resize(size_type count, T value)  
{  
    if(size() >= count)  
        return;   
    insert_aux(end(), count - size(), value, std::true_type());  
}  
示例#7
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::insert(iterator pos, InputIterator first, InputIterator last)  
{  
    typedef std::integral_constant<bool, std::is_integral<InputIterator>::value> type;  
    insert_aux(pos, first, last, type());  
}  
示例#8
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::insert(iterator pos, size_type count, const T& value)  
{  
    insert_aux(pos, count, value, std::true_type());  
}  
示例#9
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::push_front(const T& value)  
{  
    insert_aux(begin(), 1, value, std::true_type());  
}  
示例#10
0
文件: list.cpp 项目: pshizhsysu/STL
void List<T, Allocator>::push_back(const T& value)  
{  
    insert_aux(end(), 1, value, std::true_type());  
}