From e195f5bcf76750aa404b5a2b4132691b85a64f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 6 Oct 2023 12:45:50 +0300 Subject: [PATCH] =?UTF-8?q?mdbx++:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=B7=D0=BA=D0=B0=20`txn::put=5Fmultiple()`=20=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8F=20POD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index bfd83175..c19af5d2 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -4019,10 +4019,20 @@ public: size_t values_count, put_mode mode, bool allow_partial = false); template + size_t put_multiple(map_handle map, const slice &key, + const VALUE *values_array, size_t values_count, + put_mode mode, bool allow_partial = false) { + static_assert(::std::is_standard_layout::value && + !::std::is_pointer::value && + !::std::is_array::value, + "Must be a standard layout type!"); + return put_multiple(map, key, sizeof(VALUE), values_array, values_count, + mode, allow_partial); + } + template void put_multiple(map_handle map, const slice &key, const ::std::vector &vector, put_mode mode) { - put_multiple(map, key, sizeof(VALUE), vector.data(), vector.size(), mode, - false); + put_multiple(map, key, vector.data(), vector.size(), mode); } inline ptrdiff_t estimate(map_handle map, pair from, pair to) const;