MCPcopy Create free account
hub / github.com/NativeScript/android / emplace

Method emplace

test-app/runtime/src/main/cpp/robin_hood.h:1796–1821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1794
1795 template <typename... Args>
1796 std::pair<iterator, bool> emplace(Args&&... args) {
1797 ROBIN_HOOD_TRACE(this)
1798 Node n{*this, std::forward<Args>(args)...};
1799 auto idxAndState = insertKeyPrepareEmptySpot(getFirstConst(n));
1800 switch (idxAndState.second) {
1801 case InsertionState::key_found:
1802 n.destroy(*this);
1803 break;
1804
1805 case InsertionState::new_node:
1806 ::new (static_cast<void*>(&mKeyVals[idxAndState.first])) Node(*this, std::move(n));
1807 break;
1808
1809 case InsertionState::overwrite_node:
1810 mKeyVals[idxAndState.first] = std::move(n);
1811 break;
1812
1813 case InsertionState::overflow_error:
1814 n.destroy(*this);
1815 throwOverflowError();
1816 break;
1817 }
1818
1819 return std::make_pair(iterator(mKeyVals + idxAndState.first, mInfo + idxAndState.first),
1820 InsertionState::key_found != idxAndState.second);
1821 }
1822
1823 template <typename... Args>
1824 iterator emplace_hint(const_iterator position, Args&&... args) {

Callers 15

RuntimeMethod · 0.80
TempModuleMethod · 0.80
addTaskMethod · 0.80
GetTypeLongCacheMethod · 0.80
GetRequireFunctionMethod · 0.80
LoadDataMethod · 0.80
NewThreadCallbackMethod · 0.80
GetOrCreateMethod · 0.80
GetOrCreateInternalMethod · 0.80

Calls 2

iteratorClass · 0.85
destroyMethod · 0.45

Tested by 1