From 989a7c992e374e42fcc0ac8b341ebf82e7c351ee Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 26 Sep 2020 01:41:46 +0300 Subject: [PATCH] =?UTF-8?q?mdbx++:=20drop=20`mdbx:offset=5Fof`=20=D0=B8=20?= =?UTF-8?q?`mdbx::owner=5Fof`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idfd0b20677388a009d7a3e0bd29b5afb9f767b8f --- mdbx.h++ | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index 1272ba54..7d39ca75 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -178,34 +178,6 @@ using build_info = ::MDBX_build_info; /// \brief Resutrns libmdbx build information. MDBX_CXX11_CONSTEXPR const build_info &get_build() noexcept; -/// \brief Returns field offset in the container class. -template -static MDBX_CXX11_CONSTEXPR ptrdiff_t -offset_of(const MEMBER CONTAINER::*const member) { - return static_cast(static_cast( - &(static_cast(nullptr)->*member))) - - static_cast(nullptr); -} - -/// \brief Returns const pointer to container class instance -/// by const pointer to the member field. -template -static MDBX_CXX11_CONSTEXPR const CONTAINER * -owner_of(const MEMBER *ptr, const MEMBER CONTAINER::*member) { - return static_cast(static_cast( - static_cast(static_cast(ptr)) - - offset_of(member))); -} - -/// \brief Returns non-const pointer to container class instance -/// by non-const pointer to the member field. -template -static MDBX_CXX11_CONSTEXPR CONTAINER * -owner_of(MEMBER *ptr, const MEMBER CONTAINER::*member) { - return static_cast(static_cast( - static_cast(static_cast(ptr)) - offset_of(member))); -} - /// \brief constexpr-compatible strlen(). static MDBX_CXX17_CONSTEXPR size_t strlen(const char *c_str) noexcept;