本文整理汇总了C++中std::list::assign方法的典型用法代码示例。如果您正苦于以下问题:C++ list::assign方法的具体用法?C++ list::assign怎么用?C++ list::assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::list
的用法示例。
在下文中一共展示了list::assign方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTrackerInfo
//取出当前的跟踪信息,这个函数会将m_bUpdate设置为false
void ProcTracker::getTrackerInfo(std::list<CString>& trackInfo)
{
EnterCriticalSection(&m_TrackInfoListCS);
trackInfo.assign(m_TrackInfoList.begin(), m_TrackInfoList.end());
m_bUpdate = false;
LeaveCriticalSection(&m_TrackInfoListCS);
}
示例2: matching_traveled_edges
void matching_traveled_edges(std::unordered_set<HGVertex*> &mv, GraphListEntry &g,
std::unordered_set<HGEdge*> &edge_set, std::list<TravelerList*> &traveler_lists)
{ // return a set of edges for the traveled graph format,
// optionally restricted by region or system or placeradius
std::unordered_set<TravelerList*> trav_set;
for (HGVertex *v : mv)
{ if (v->visibility < 1) continue;
for (HGEdge *e : v->incident_t_edges)
if (!g.placeradius || g.placeradius->contains_edge(e))
{ bool rg_in_rg = 0;
if (g.regions) for (Region *r : *g.regions)
if (r == e->segment->route->region)
{ rg_in_rg = 1;
break;
}
if (!g.regions || rg_in_rg)
{ bool system_match = !g.systems;
if (!system_match)
for (std::pair<std::string, HighwaySystem*> &rs : e->route_names_and_systems)
{ bool sys_in_sys = 0;
if (g.systems) for (HighwaySystem *s : *g.systems)
if (s == rs.second)
{ sys_in_sys = 1;
break;
}
if (sys_in_sys) system_match = 1;
}
if (system_match)
{ edge_set.insert(e);
for (TravelerList *t : e->segment->clinched_by) trav_set.insert(t);
}
}
}
}
traveler_lists.assign(trav_set.begin(), trav_set.end());
traveler_lists.sort(sort_travelers_by_name);
}
示例3: bad_assign_list1
void bad_assign_list1(std::list<int> &L, int n) {
auto i0 = L.cbegin();
L.assign(10, n);
*i0; // expected-warning{{Invalidated iterator accessed}}
}
示例4: GetChildren
bool nuiTreeBase::GetChildren(std::list<nuiTreePtr>& rChildren)
{
rChildren.clear();
rChildren.assign(mpChildren.begin(), mpChildren.end());
return false;
}
示例5: list_assign
static void list_assign(std::list<T>& l, bp::object o)
{
// Turn a Python sequence into an STL input range
bp::stl_input_iterator<T> begin(o), end;
l.assign(begin, end);
}
示例6: ConstructFramePoolPointer
/*Construct frame pointers for each frame in the pool*/
void TrackAssociation::ConstructFramePoolPointer(std::list<ImageRepresentation*> &frame_p_list)
{
frame_p_list.clear();
frame_p_list.assign(frame_pool.cbegin(),frame_pool.cend());
}