-
Notifications
You must be signed in to change notification settings - Fork 195
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
PointCloudUtils does not compile #1959
Comments
@S-Dafarra was describing a simiilar problem during lunch yesterday. |
The only solution for now is to either copy-paste the content of Unfortunately |
I think this is a slightly different issue. What I experienced was that Visual Studio was failing to substitute the following template (https://github.com/S-Dafarra/levi/blob/e5ad65b5a6/include/levi/OperatorsEvaluables.h#L76-L77): template<typename Scalar_lhs, int lhsRows, int lhsCols, typename Scalar_rhs, int rhsRows, int rhsCols>
struct levi::matrix_product_return<Eigen::Matrix<Scalar_lhs, lhsRows, lhsCols>, Eigen::Matrix<Scalar_rhs, rhsRows, rhsCols> The problem was that
Once I saw an answer on
template<bool value>
struct bool_value{}
template<bool value>
void copyA(bool_value<value> /*, other parameters*/);
void copyA(bool_value<true> /*, other parameters*/) {
// True case
}
void copyA(bool_value<value> /*, other parameters*/) {
// False case
}
copyA(bool_value</*condition to check*/>(), /*other parameters*/) |
@S-Dafarra I agreee that they are two different problems. What you suggest is useful, but will lead to two different implementation of a function and in the end we could just implement a template specialization for |
We analyzed with godbolt the compilation result of this code snippet: // Type your code here, or load an example.
int square(int num) {
int pippo = 2;
if(false) {
pippo=5;
}
return num * num;
} And the code inside the |
I should add a test for this case and see if the compilation in windows is still faling. |
I have just stepped into this issue on Linux. Config:
|
A "broken" testcase would be quite useful, in case someone wants to prepare it... |
Just changing yarp/tests/libYARP_sig/PointCloudTest.cpp Lines 915 to 933 in 308c8bb
But "broken" here means "don't compile at all", not "make test fail". |
Fixed by #2363 |
Describe the bug
Calling
yarp::sig::utils::depthRgbToPC
withT2
class type differentr from eitheryarp::sig::PixelRgba
oryarp::sig::PixelBgra
, for examplegives the following error
Expected behavior
Visual Studio compiler is not able to optimize, i.e. remove with branch hints, the following if statement
yarp/src/libYARP_sig/include/yarp/sig/PointCloudUtils-inl.h
Lines 46 to 49 in ec09c81
while other compilers do (gcc, clang).
Configuration (please complete the following information):
3.1.100+20181113.21+gitd93264183
cl
toolchainv141
cc @Nicogene
The text was updated successfully, but these errors were encountered: