本文整理汇总了C++中std::forward_list::emplace_front方法的典型用法代码示例。如果您正苦于以下问题:C++ forward_list::emplace_front方法的具体用法?C++ forward_list::emplace_front怎么用?C++ forward_list::emplace_front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::forward_list
的用法示例。
在下文中一共展示了forward_list::emplace_front方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddCollideLine
void TutorialMobManager::AddCollideLine(std::forward_list<Line>& lines)
{
std::forward_list<ActorPtr> children;
children.swap(this->GetChildren());
const size_t listCount = Utility::GetListSize(children);
std::vector<ActorPtr> mobs;
for (auto& m : children) {
mobs.emplace_back(m);
}
for (unsigned int i = 0; i < listCount; ++i) {
for (unsigned int j = 0; j < listCount; ++j) {
if (i == j || i > j)
continue;
if (IsLongDistancePlayer(mobs, i, j))
continue;
if (IsBackSidePlayer(mobs, i, j))
continue;
Vector3 playerFront = -player->GetMatrix().GetFront();
Line line = Line(mobs[i]->GetPosition() + playerFront * 5.0f, mobs[j]->GetPosition() + playerFront * 5.0f);
lines.emplace_front(line);
}
}
}
示例2: findLoadedParent
/**
* Find a loaded parent of the given tile.
*
* @param id The tile ID that we should find children for.
* @param minCoveringZoom The minimum zoom level of parents to look for.
* @param retain An object that we add the found tiles to.
*
* @return boolean Whether a parent was found.
*/
bool Source::findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::forward_list<Tile::ID>& retain) {
for (int32_t z = id.z - 1; z >= minCoveringZoom; --z) {
const Tile::ID parent_id = id.parent(z);
const TileData::State state = hasTile(parent_id);
if (state == TileData::State::parsed) {
retain.emplace_front(parent_id);
return true;
}
}
return false;
}
示例3: findLoadedChildren
/**
* Recursively find children of the given tile that are already loaded.
*
* @param id The tile ID that we should find children for.
* @param maxCoveringZoom The maximum zoom level of children to look for.
* @param retain An object that we add the found tiles to.
*
* @return boolean Whether the children found completely cover the tile.
*/
bool Source::findLoadedChildren(const Tile::ID& id, int32_t maxCoveringZoom, std::forward_list<Tile::ID>& retain) {
bool complete = true;
int32_t z = id.z;
auto ids = id.children(z + 1);
for (const Tile::ID& child_id : ids) {
const TileData::State state = hasTile(child_id);
if (state == TileData::State::parsed) {
retain.emplace_front(child_id);
} else {
complete = false;
if (z < maxCoveringZoom) {
// Go further down the hierarchy to find more unloaded children.
findLoadedChildren(child_id, maxCoveringZoom, retain);
}
}
}
return complete;
}
示例4: AddAttribute
void AddAttribute(const TCHAR *name, size_t name_length,
const TCHAR *value, size_t value_length) {
attributes.emplace_front(name, name_length, value, value_length);
}
示例5: add_follower
int add_follower(const std::string& base, const std::string& filter, Object& response)
{
m_following.emplace_front(new PulleySyncRepl(base, filter, m_parser));
m_following.front()->execute(*m_connection, &response);
return 0;
}
示例6: good_emplace_front_forward_list1
void good_emplace_front_forward_list1(std::forward_list<int> &FL, int n) {
auto i0 = FL.cbegin(), i1 = FL.cend();
FL.emplace_front(n);
*i0; // no-warning
}
示例7:
jmp_buf *
exceptions_state_mc_init ()
{
catchers.emplace_front ();
return &catchers.front ().buf;
}
示例8: emplace
inline void emplace(EArgs&&... args)
{
slots.emplace_front(std::forward<EArgs>(args)...);
}
示例9: AddAttribute
void AddAttribute(TCHAR *name, TCHAR *value) {
pAttribute.emplace_front(name, value);
}
示例10: AddAttribute
void AddAttribute(tstring &&name,
const TCHAR *value, size_t value_length) {
attributes.emplace_front(std::move(name), value, value_length);
}