mirror of
https://github.com/Z3Prover/z3
synced 2025-07-19 10:52:02 +00:00
Basic support for non-copyable types in map
This commit is contained in:
parent
e105a91d4a
commit
6c4d60c5af
1 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,10 @@ struct _key_data {
|
||||||
m_key(k),
|
m_key(k),
|
||||||
m_value(v) {
|
m_value(v) {
|
||||||
}
|
}
|
||||||
|
_key_data(Key const& k, Value&& v):
|
||||||
|
m_key(k),
|
||||||
|
m_value(std::move(v)) {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Entry, typename HashProc, typename EqProc>
|
template<typename Entry, typename HashProc, typename EqProc>
|
||||||
|
@ -107,6 +111,10 @@ public:
|
||||||
m_table.insert(key_data(k, v));
|
m_table.insert(key_data(k, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void insert(key const& k, value&& v) {
|
||||||
|
m_table.insert(key_data(k, std::move(v)));
|
||||||
|
}
|
||||||
|
|
||||||
bool insert_if_not_there_core(key const & k, value const & v, entry *& et) {
|
bool insert_if_not_there_core(key const & k, value const & v, entry *& et) {
|
||||||
return m_table.insert_if_not_there_core(key_data(k,v), et);
|
return m_table.insert_if_not_there_core(key_data(k,v), et);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue