-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix compile in itk reader/writer #1153
Conversation
@@ -64,7 +64,8 @@ namespace DGtal { | |||
const Domain& domain = dgtal_itk_image.domain(); | |||
|
|||
typedef ConstImageAdapter<DGtalITKImage, Domain, functors::Identity, Value, Functor> AdaptedImage; | |||
const AdaptedImage adapted(dgtal_itk_image, domain, functors::Identity(), aFunctor); | |||
const functors::Identity identityFunctor{}; |
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.
why {}
?
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.
I apply the same change of @rolanddenis ;) looks fine without with my compilo but I suppose that there a reason.
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.
😄
In that case, it is exactly the same as without {}
: it calls the constructor without argument. It is a new syntax from C++11
. It enhances the construction of object and, especially, it allows me to replace a common mistake that I make:
const functors::Identity identityFunctor();
by a valid syntax:
const functors::Identity identityFunctor{};
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.
Well, I would have preferred to get the () removed instead of something that can be ambiguous for non-c11 dev.
(Not sure to see why this new syntax enhance the construction.. I'll have to read the doc;))
beside my minor comment, this PR is fine. |
dec cosmetic fix
fixing extension removal
ok @dcoeurjo I have remove the {} since @rolanddenis confirms that in this case it is equivalent. |
Yes I agree. Thanks |
(Just waiting for Travis ;)) |
Don't merge yet: do you have try to compile it with clang ? It should fail because of the missing
failed with |
There is a small rule when using default initialization with constant object (§8.5/7):
It seems that this rule exists to avoid invalid initialization of POD class with
Refs:
|
thanks @rolanddenis , yes you are right it fails, perhaps I wrongly switch branch by testing by removing it, sorry ;( ! |
Thanks for the details! I've learned a lot of things. |
perhaps the default constructor is better but we will lost the POD of Identity, but I don't know if it is a problem to be no more Plain Old Data ? |
I found that strange to provide a default constructor that do nothing in a class that owns nothing (and that could have only |
Ok, you're both right. Let's keep the {} for const instanciations. So, can i merge this branch or you need to revert your edits, Bertrand ? |
I revert it just now, I was waiting the end of discussion ;) |
…rior3D Fix fill interior exterior 3d
🆗 |
done |
README page update (license)
* fix empty faces in align axis tubular direction and better optimisation on face association (approx hausdorff distance instead using direction) * add visual test * complete testMesh * Changelog * fix typo test and better test nb faces * clean in test * typo
@dcoeurjo can we merge? |
Yep merging. Thanks |
fix compile in itk reader/writer
thanks! ;)
|
ok.. there is an issue.. could you please merge the master back ? |
it looks like it was just a meriging bug ! ;)
|
PR Description
fix compile in itk reader/writer
Checklist
cmake
mode (otherwise, Travis C.I. will fail).