mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Add mk_algebraic method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
872165fa55
commit
4a0b431cf4
2 changed files with 74 additions and 11 deletions
|
@ -53,11 +53,11 @@ private:
|
|||
set_data(mem, sz);
|
||||
}
|
||||
|
||||
void init() {
|
||||
void init(T const & v) {
|
||||
iterator it = begin();
|
||||
iterator e = end();
|
||||
for (; it != e; ++it) {
|
||||
new (it) T();
|
||||
new (it) T(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,6 +140,13 @@ public:
|
|||
init(vs);
|
||||
}
|
||||
|
||||
template<typename Allocator>
|
||||
void set(Allocator & a, size_t sz, T const & v = T()) {
|
||||
SASSERT(m_data == 0);
|
||||
allocate(a, sz);
|
||||
init(v);
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
if (m_data == 0) {
|
||||
return 0;
|
||||
|
@ -181,6 +188,7 @@ public:
|
|||
void swap(array & other) {
|
||||
std::swap(m_data, other.m_data);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue