当前位置: 首页>>代码示例>>C++>>正文


C++ container_type::push_back方法代码示例

本文整理汇总了C++中container_type::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ container_type::push_back方法的具体用法?C++ container_type::push_back怎么用?C++ container_type::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在container_type的用法示例。


在下文中一共展示了container_type::push_back方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

    static inline void add_to_hull(point_type const& p, container_type& output)
    {
        typedef typename strategy::side::services::default_strategy<cs_tag>::type side;

        output.push_back(p);
        std::size_t output_size = output.size();
        while (output_size >= 3)
        {
            rev_iterator rit = output.rbegin();
            point_type const last = *rit++;
            point_type const& last2 = *rit++;

            if (Factor * side::apply(*rit, last, last2) <= 0)
            {
                // Remove last two points from stack, and add last again
                // This is much faster then erasing the one but last.
                output.pop_back();
                output.pop_back();
                output.push_back(last);
                output_size--;
            }
            else
            {
                return;
            }
        }
    }
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:27,代码来源:hull_graham_andrew.hpp

示例2: push

 /// <summary>
 /// Enqueues the given value into our thread-safe blocking queue.  The programmer becomes 
 /// responsible for the lifetime of the parameter while it is within the queue; before the
 /// queue is disposed, the programmer must empty it and dispose of its contents.
 /// </summary>
 void push(T const& value)
 {
    {
       lock_type lock(m_mutex);
       m_queue.push_back(value);
    }
    m_condition.notify_one();
 }
开发者ID:ItzWarty,项目名称:the-dargon-project,代码行数:13,代码来源:blocking_queue.hpp

示例3:

 node * create_node (value_type const & value
         , priority_value_type priority
         , node * left
         , node * right)
 {
     _d.push_back(node(value, priority, left, right));
     return & _d.back();
 }
开发者ID:semenovf,项目名称:pfs,代码行数:8,代码来源:implicit_treap.hpp

示例4:

 static inline void build_half_hull(container_type const& input,
         container_type& output,
         point_type const& left, point_type const& right)
 {
     output.push_back(left);
     for(iterator it = input.begin(); it != input.end(); ++it)
     {
         add_to_hull<Factor>(*it, output);
     }
     add_to_hull<Factor>(right, output);
 }
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:11,代码来源:hull_graham_andrew.hpp

示例5:

		static void                                  push_back(container_type& cont, const PointExpr& p) { cont.push_back(p); }
开发者ID:,项目名称:,代码行数:1,代码来源:

示例6: add

	void add(request_spec *spec, request_handler *handler)
	{
		request_handlers_.push_back(std::make_pair(spec, handler));
	}
开发者ID:hamazy,项目名称:shiritori,代码行数:4,代码来源:game.hpp

示例7: make_next

		void make_next(void)
		{
			container.push_back(fact());
		}
开发者ID:Manokha,项目名称:firestarter,代码行数:4,代码来源:arrayer_holder.hpp

示例8: deltaFml

void deltaFml (const container_type& positions, container_type& forces)
{
    forces.clear ();
    forces.push_back (2*(positions.at (0)+20));
    forces.push_back (2*(positions.at (1)-43));
}
开发者ID:bortigno,项目名称:tmva,代码行数:6,代码来源:test_lbfgs.cpp

示例9: push_vertex

 void push_vertex(value_type x, value_type y, CommandType c) 
 {
     cont_.push_back(x,y,c);
 }
开发者ID:ParveenArora,项目名称:mapnik,代码行数:4,代码来源:geometry.hpp

示例10: move_to

 void move_to(value_type x,value_type y)
 {
     cont_.push_back(x,y,SEG_MOVETO);
 }
开发者ID:achoch,项目名称:mapnik,代码行数:4,代码来源:geometry.hpp

示例11: line_to

 void line_to(value_type x,value_type y)
 {
     cont_.push_back(x,y,SEG_LINETO);
 }
开发者ID:achoch,项目名称:mapnik,代码行数:4,代码来源:geometry.hpp

示例12: push_vertex

 void push_vertex(coord_type x, coord_type y, CommandType c)
 {
     cont_.push_back(x,y,c);
 }
开发者ID:syordanov,项目名称:mapnik,代码行数:4,代码来源:geometry.hpp


注:本文中的container_type::push_back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。