Templatize so it works both before and after RMW changes#2
Templatize so it works both before and after RMW changes#2rotu wants to merge 1 commit intoeboasson:pubsub-optionsfrom
Conversation
|
This is awesome! It's a busy day and I haven't had a chance to try it out properly, but let's see if I actually understand what it does ... If it's the "old" interface, the If it is the "new" interface, then defining the old version is an overloaded variant that isn't affected by the Or something like that ... I suppose ... I'm not very good with the behaviour of C++ templates ... Tomorrow I should have a chance to look at it more closely. |
|
Thanks! I did this because I wanted to learn/practice SFINAE and templates in general. You’re exactly right. The other gotcha is, even in the template that doesn’t get instantiated, |
7838a42 to
f0267c5
Compare
Note that the `extern "C"` declarations in this file are quite unnecessary - due to the rmw.h header, the declared interface will have C linkage (though there may be additional overloads that use C++ linkage)
f0267c5 to
2fc4174
Compare
|
Had to change function definition order so the new API functions can call the old API functions. Oops. |
|
@rotu I am very sorry that I have to tell you that on Eloquent with macOS the templating gives problems ... it compiles and links cleanly, but when I try to run something it complains that Fortunately, there is now this: ros2/rmw#188 (comment). Would you be willing to change Then you can get the credit for fixing things, as is only right :) |
|
I’m on it. I think the weirdness on Mac is that the template definition is in an object file, whereas usually template definitions are in a header file. Oh well. I’ll make the change - it’s a minor modification on my #ifdef based attempt |
Note that the
extern "C"declarations in this file are quite unnecessary - due to the rmw.h header, the declared interface will have C linkage (though there may be additional overloads that use C++ linkage)