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


C++ forward_list::emplace_front方法代码示例

本文整理汇总了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);

		}
	}
}
开发者ID:ASO4649,项目名称:Dxlib_3DGame,代码行数:31,代码来源:TutorialMobManager.cpp

示例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;
}
开发者ID:ariosx,项目名称:mapbox-gl-native,代码行数:20,代码来源:source.cpp

示例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;
}
开发者ID:ariosx,项目名称:mapbox-gl-native,代码行数:27,代码来源:source.cpp

示例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);
 }
开发者ID:damianob,项目名称:xcsoar,代码行数:4,代码来源:Node.hpp

示例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;
	}
开发者ID:arpa2,项目名称:steamworks,代码行数:6,代码来源:pulley.cpp

示例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
}
开发者ID:LegalizeAdulthood,项目名称:clang,代码行数:5,代码来源:invalidated-iterator.cpp

示例7:

jmp_buf *
exceptions_state_mc_init ()
{
  catchers.emplace_front ();
  return &catchers.front ().buf;
}
开发者ID:T-J-Teru,项目名称:binutils-gdb,代码行数:6,代码来源:common-exceptions.c

示例8: emplace

 inline void emplace(EArgs&&... args)
 {
     slots.emplace_front(std::forward<EArgs>(args)...);
 }
开发者ID:ftk,项目名称:niceamx,代码行数:4,代码来源:signal.hpp

示例9: AddAttribute

 void AddAttribute(TCHAR *name, TCHAR *value) {
   pAttribute.emplace_front(name, value);
 }
开发者ID:davidswelt,项目名称:XCSoar,代码行数:3,代码来源:xmlParser.hpp

示例10: AddAttribute

 void AddAttribute(tstring &&name,
                   const TCHAR *value, size_t value_length) {
   attributes.emplace_front(std::move(name), value, value_length);
 }
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:4,代码来源:Node.hpp


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