-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xapian headers are not exposed through libkiwix #470
Conversation
Codecov Report
@@ Coverage Diff @@
## master #470 +/- ##
==========================================
- Coverage 63.07% 63.03% -0.04%
==========================================
Files 50 50
Lines 3496 3501 +5
Branches 1776 1767 -9
==========================================
+ Hits 2205 2207 +2
- Misses 1289 1292 +3
Partials 2 2
Continue to review full report at Codecov.
|
516f0c1
to
d66e2bd
Compare
@veloman-yunkan Considering that this PR seems really trivial, I consider to just merge it. Hopefully this is right. |
d66e2bd
to
a9c9b27
Compare
@veloman-yunkan Kiwix Desktop git master seems to fail to compile against this:
|
@kelson42 This particular case can be easily fixed by adding a new method Making Finally, it can be fixed on the kiwix-desktop side by changing the type of |
@veloman-yunkan Thx for the analysis, I will let you discuss these solutions with @mgautierfr and I will abort my project to merge this PR for the moment :) |
We probably need to declare a move assignment operator/constructor (using default). |
I don't think that it is good/intuitive semantics for the
If we hit more cases when |
Why ? This is totally valid to move a There is a default (implicit) move constructor/assignment implemented when possible. But if we explicitly delete the copy constructor, then the default move constructor is not implicitly implemented. We need to explicitly "ask" it again with Implementing a move semantics doesn't invalidate the other options.
Most of the time the intuitive semantics is that we can copy/move a object. In complex type, copying may not be a easy step and this can be disputable. |
@mgautierfr I don't agree with your justification for making |
I somehow missed that in general copyability and movability are not mutually exclusive. A non-copyable class with a move constructor and move assignment can be made copyable later without removing the move functionality (the latter then becomes just an optimization for r-value sources). |
As far as possible the libkiwix complexity should be ar the lowest level possible and its usage should be as flexible as possible. I understand the libkiwix API has to evolve to be better and offer more functionalities. Therefore this is OK to some extend to brake the compatibility if necessary, but then:
|
It is a pity. The goal of all those discussion is to agree on a current solution "the best we can do for the moment". Agree on which solution is the best now and avoid any API change later should globally be our goal (I personally don't want to go back on this and change all the use of If you have arguments to not implement a solution I prefer to discuss it now instead of having a "I told you so" later.
Yes. I speaking only about the move semantic. All internal objects in
The
I agree. |
This is certainly not the case now. I never implied that discussions of important matters should end in such a way. My comment only reflected my opinion that this issue was starting to generate more discussion than it deserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kiwix-desktop doesn't compile with this version.
We need to declare the move constructor/operator in the header but define it (using =default
in the cpp).
Else, the default implementation tries to use the unique_ptr destructor which don't know the size of BookDB (at the time it is implemented).
On top of that, I recently realize we don't need to declare a intermediate object (BookDB
).
We can do a forward declaration of Xapian::WritableDatabase
and directly use it with a unique_ptr
.
I tend to use a intermediate struct where it was unnecessary.
But I will not block for that, especially as BookDb also hides the writableDatabase constructor arguments.
1e2dc16
to
2b3413d
Compare
I missed that. Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are good.
Please rebase-fixup before the merge.
2b3413d
to
aa2a031
Compare
Done |
Fixes #469