mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-10-31 03:29:01 +08:00 
			
		
		
		
	mdbx++: добавление mdbx::cursor_managed::withdraw_handle() (backport).
				
					
				
			This commit is contained in:
		
							
								
								
									
										8
									
								
								mdbx.h++
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								mdbx.h++
									
									
									
									
									
								
							| @@ -4155,9 +4155,9 @@ public: | |||||||
| class LIBMDBX_API_TYPE cursor { | class LIBMDBX_API_TYPE cursor { | ||||||
| protected: | protected: | ||||||
|   MDBX_cursor *handle_{nullptr}; |   MDBX_cursor *handle_{nullptr}; | ||||||
|   MDBX_CXX11_CONSTEXPR cursor(MDBX_cursor *ptr) noexcept; |  | ||||||
|  |  | ||||||
| public: | public: | ||||||
|  |   MDBX_CXX11_CONSTEXPR cursor(MDBX_cursor *ptr) noexcept; | ||||||
|   MDBX_CXX11_CONSTEXPR cursor() noexcept = default; |   MDBX_CXX11_CONSTEXPR cursor() noexcept = default; | ||||||
|   cursor(const cursor &) noexcept = default; |   cursor(const cursor &) noexcept = default; | ||||||
|   inline cursor &operator=(cursor &&other) noexcept; |   inline cursor &operator=(cursor &&other) noexcept; | ||||||
| @@ -4561,6 +4561,12 @@ public: | |||||||
|     return *this; |     return *this; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   inline MDBX_cursor *withdraw_handle() noexcept { | ||||||
|  |     MDBX_cursor *handle = handle_; | ||||||
|  |     handle_ = nullptr; | ||||||
|  |     return handle; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   cursor_managed(const cursor_managed &) = delete; |   cursor_managed(const cursor_managed &) = delete; | ||||||
|   cursor_managed &operator=(const cursor_managed &) = delete; |   cursor_managed &operator=(const cursor_managed &) = delete; | ||||||
|   ~cursor_managed() noexcept { ::mdbx_cursor_close(handle_); } |   ~cursor_managed() noexcept { ::mdbx_cursor_close(handle_); } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user