[windows] Fix ambiguous call for tf2::convert on MSVC#462
[windows] Fix ambiguous call for tf2::convert on MSVC#462tfoote wants to merge 1 commit intonoetic-develfrom
Conversation
* rework ambiguous call on MSVC.
|
I don't want to be disrespectful, but I pointed out the problem at multiple places. Please correct me if I'm wrong. IMHO, the whole conversion stuff boils down to something like (taken from here) #include <iostream>
namespace msgs {
struct A_msg {
A_msg(){} // for clang
};
}
namespace datatypes {
struct B_dt {};
}
namespace tf2 {
template <class A, class B>
void fromMsg(const A&, B&);
template <class A, class B>
void convert(const A& a, B& b) {
fromMsg(a, b);
}
//template<>
void fromMsg(const msgs::A_msg& a, datatypes::B_dt& b) {}
}
int main () {
const msgs::A_msg a;
datatypes::B_dt b;
tf2::convert(a, b);
std::cout << "Hello, world!\n";
}Compilation/linking fails with GCC, Clang and MSVC (with namespace tf2 {
void fromMsg(const msgs::A_msg& a, datatypes::B_dt& b) {}
template <class A, class B>
void fromMsg(const A&, B&);
template <class A, class B>
void convert(const A& a, B& b) {
fromMsg(a, b);
}
}it works fine. When the conversion is requested, |
|
@tfoote Sorry this is out of my radar. I will be checking this one soon. |
|
Thank you for the PR! ROS Noetic will reach end-of-life on May 31st, 2025. Every change comes with a risk of introducing regressions, and there isn't much time left to fix them. To make sure this PR doesn't introduce any regressions please:
|
|
ROS 1 is end-of-life (EOL) as of today, May 31st 2025. I am archiving this repository because:
If you still rely on ROS 1, read this page to learn about your options. |
Forward port of #444 to noetic