本文整理汇总了C++中std::set::emplace方法的典型用法代码示例。如果您正苦于以下问题:C++ set::emplace方法的具体用法?C++ set::emplace怎么用?C++ set::emplace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::set
的用法示例。
在下文中一共展示了set::emplace方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: idm_get_set
void idm_get_set(std::set<u32>& out)
{
idm::select<T, Get>([&](u32 id, Get&)
{
out.emplace(id);
});
}
示例2: ReportFixture
bool ReportFixture(b2Fixture* fix) override
{
if ((fix->GetFilterData().maskBits & group) && (mask & fix->GetFilterData().groupIndex))
overlaps.emplace(static_cast<Collider2D*>(fix->GetBody()->GetUserData()));
return true;
}
示例3: scanLine
static void scanLine(int _x0, int _x1, int _y, int _z, std::set<TileID>& _tiles) {
for (int x = _x0; x < _x1; x++) {
_tiles.emplace(x, _y, _z);
}
}
示例4: MapCalcFromFile
/*
Try to map calc.exe into current process
*/
void MapCalcFromFile()
{
Process thisProc;
thisProc.Attach( GetCurrentProcessId() );
nativeMods.clear();
modList.clear();
nativeMods.emplace( L"combase.dll" );
nativeMods.emplace( L"user32.dll" );
if (WinVer().ver == Win7)
{
nativeMods.emplace( L"gdi32.dll" );
nativeMods.emplace( L"msvcr120.dll" );
nativeMods.emplace( L"msvcp120.dll" );
}
modList.emplace( L"windows.storage.dll" );
modList.emplace( L"shell32.dll" );
modList.emplace( L"shlwapi.dll" );
auto callback = []( CallbackType type, void* /*context*/, Process& /*process*/, const ModuleData& modInfo )
{
if(type == PreCallback)
{
if(nativeMods.count(modInfo.name))
return LoadData( MT_Native, Ldr_None );
}
else
{
if (modList.count( modInfo.name ))
return LoadData( MT_Default, Ldr_ModList );
}
return LoadData( MT_Default, Ldr_None );
};
std::wcout << L"Manual image mapping test" << std::endl;
std::wcout << L"Trying to map C:\\windows\\system32\\calc.exe into current process" << std::endl;
auto image = thisProc.mmap().MapImage( L"C:\\windows\\system32\\calc.exe", ManualImports | RebaseProcess, callback );
if (!image)
{
std::wcout << L"Mapping failed with error 0x" << std::hex << image.status
<< L". " << Utils::GetErrorDescription( image.status ) << std::endl << std::endl;
}
else
std::wcout << L"Successfully mapped, unmapping\n";
thisProc.mmap().UnmapAllModules();
}
示例5: setKeyPress
void setKeyPress(int key) { press_.emplace(key); }
示例6: setKeyPull
void setKeyPull(int key) { pull_.emplace(key); }
示例7: setKeyPush
void setKeyPush(int key) { push_.emplace(key); }
示例8: setButtonPress
void setButtonPress(int button) { press_.emplace(button); }
示例9: setButtonPull
void setButtonPull(int button) { pull_.emplace(button); }
示例10: setButtonPush
void setButtonPush(int button) { push_.emplace(button); }
示例11: add_location
void add_location(const osmium::Location& location) {
if (location.valid()) {
m_dirty_tiles.emplace(m_zoom, location);
}
}