diff options
| author | Tyge Lovset <[email protected]> | 2022-04-20 09:10:50 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-04-20 09:10:50 +0200 |
| commit | 7254bcc776d4dd5dd2e3e20598858618d5eddcdc (patch) | |
| tree | 050e9b4522eaaa69578704a0788dcb97170b4079 /include/stc/cpque.h | |
| parent | a9c0f215e3e98c165de07d9661595b0dd64cc4fb (diff) | |
| download | STC-modified-7254bcc776d4dd5dd2e3e20598858618d5eddcdc.tar.gz STC-modified-7254bcc776d4dd5dd2e3e20598858618d5eddcdc.zip | |
Support for cloning containers with carc and cbox.
Disabled emplace methods for containers with carc and cbox.
Diffstat (limited to 'include/stc/cpque.h')
| -rw-r--r-- | include/stc/cpque.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/stc/cpque.h b/include/stc/cpque.h index 794c73ce..9844fc93 100644 --- a/include/stc/cpque.h +++ b/include/stc/cpque.h @@ -96,7 +96,7 @@ STC_INLINE void _cx_memb(_copy)(_cx_self *self, _cx_self other) { _cx_memb(_drop)(self); *self = _cx_memb(_clone)(other);
}
STC_INLINE i_val _cx_memb(_value_clone)(_cx_value val)
- { i_valraw r = i_valto((&val)); return i_valfrom(r); }
+ { return i_valclone(val); }
#if !defined _i_no_emplace
STC_INLINE void _cx_memb(_emplace)(_cx_self* self, _cx_raw raw)
@@ -127,9 +127,8 @@ _cx_memb(_make_heap)(_cx_self* self) { #if !defined _i_no_clone
STC_DEF _cx_self _cx_memb(_clone)(_cx_self q) {
_cx_self out = _cx_memb(_with_capacity)(q.size);
- i_valraw r;
for (; out.size < out.capacity; ++q.data)
- r = i_valto(q.data), out.data[out.size++] = i_valfrom(r);
+ out.data[out.size++] = i_valclone((*q.data));
return out;
}
#endif
|
