mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 00:29:21 +00:00
feat(Variant): add copy constructor impl
This commit is contained in:
parent
d09232f313
commit
261b8cc880
1 changed files with 12 additions and 1 deletions
|
|
@ -66,7 +66,18 @@ Variant::Variant (Type type) : Variant() {
|
|||
}
|
||||
|
||||
Variant::Variant (const Variant &src) {
|
||||
// TODO.
|
||||
// Don't call placement new.
|
||||
L_ASSERT(!mPrivate);
|
||||
mPrivate = new VariantPrivate();
|
||||
|
||||
L_D(Variant);
|
||||
d->type = src.getPrivate()->type;
|
||||
|
||||
const VariantPrivate::Value &value = src.getPrivate()->value;
|
||||
if (d->type == String)
|
||||
d->value.str = new string(*value.str);
|
||||
else
|
||||
d->value = value;
|
||||
}
|
||||
|
||||
Variant::Variant (Variant &&src) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue