2
0
mirror of https://github.com/boostorg/json.git synced 2026-02-15 13:12:17 +00:00

Fix strings test

This commit is contained in:
Vinnie Falco
2019-11-17 15:26:17 -08:00
parent 43ceae3565
commit afa29d0ce8
3 changed files with 98 additions and 141 deletions

View File

@@ -102,11 +102,7 @@ public:
std::random_access_iterator_tag)
: string_impl(last - first, sp)
{
#ifdef _MSC_VER
std::copy(first, last, data());
#else
std::copy(first, last, data(), data() + size());
#endif
}
template<class InputIt>

View File

@@ -70,13 +70,13 @@ insert(
}
};
// We use the global storage since
// it is a temporary deallocated here.
// We use the default storage because
// the allocation is immediately freed.
storage_ptr dsp;
detail::string_impl tmp(
first, last,
storage_ptr{},
first, last, dsp,
iter_cat<InputIt>{});
cleanup c{tmp, storage_ptr{}};
cleanup c{tmp, dsp};
auto const off = pos - impl_.data();
traits_type::copy(
impl_.insert(off, tmp.size(), sp_),
@@ -154,13 +154,13 @@ append(
}
};
// We use the global storage since
// it is a temporary deallocated here.
// We use the default storage because
// the allocation is immediately freed.
storage_ptr dsp;
detail::string_impl tmp(
first, last,
storage_ptr{},
first, last, dsp,
std::input_iterator_tag{});
cleanup c{tmp, storage_ptr{}};
cleanup c{tmp, dsp};
traits_type::copy(
impl_.append(tmp.size(), sp_),
tmp.data(), tmp.size());