You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
This appears erroneous. istream.getloc() returns a locale object, which cannot be assigned to a char variable.
clang (800.0.38) reports a compilation error on this.
g++-4.9 and g++-6 accept this code; don't know why. (Perhaps because it is a template that is never instantiated?)
I believe overloaded istream operator >> should not produce any diagnostic upon error, but rather return the istream with appropriate flags set. It is then up to the caller to check the istream and produce diagnostics, if necessary.
In this case, it may be sufficient to just return "is", since it should already have the error flag set.
The reason will be displayed to describe this comment to others. Learn more.
Hi Guys,
Having this same issue.
Scanning dependencies of target cmvs_lib
[ 1%] Building CXX object base/cmvs/CMakeFiles/cmvs_lib.dir/bundle.cc.o
In file included from /Users/Aaron/CMVS-PMVS-master/program/base/cmvs/bundle.cc:10:
In file included from /Users/Aaron/CMVS-PMVS-master/program/base/cmvs/bundle.h:15:
In file included from /Users/Aaron/CMVS-PMVS-master/program/base/cmvs/../stann/sfcnn.hpp:31:
In file included from /Users/Aaron/CMVS-PMVS-master/program/base/cmvs/../stann/zorder_lt.hpp:20:
/Users/Aaron/CMVS-PMVS-master/program/base/cmvs/../stann/dpoint.hpp:491:12: error:
no viable conversion from 'std::__1::locale' to 'char'
char errorpoint = is.getloc();
^ ~~~~~~~~~~~
1 error generated.
make[2]: *** [base/cmvs/CMakeFiles/cmvs_lib.dir/bundle.cc.o] Error 1
make[1]: *** [base/cmvs/CMakeFiles/cmvs_lib.dir/all] Error 2
make: *** [all] Error 2
libpba.so failed to build, halting....
Aarons-MacBook-Pro:~ Aaron$
I tried to insert as indicated above, but when I save that line into the dpoint.hpp code, then reopen the code in xcode, the saved changes dissapear, and thus I keep getting the same error when I run the .sh
9c4cbe2
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.
This appears erroneous. istream.getloc() returns a locale object, which cannot be assigned to a char variable.
clang (800.0.38) reports a compilation error on this.
g++-4.9 and g++-6 accept this code; don't know why. (Perhaps because it is a template that is never instantiated?)
9c4cbe2
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.
You would recommend to remove the error parsing and just exit?
9c4cbe2
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 googled a bit:
http://stackoverflow.com/questions/1280885/safely-overloading-stream-operator
http://www.cplusplus.com/reference/istream/istream/operator%3E%3E/
https://www.tutorialspoint.com/cplusplus/input_output_operators_overloading.htm
I believe overloaded istream operator >> should not produce any diagnostic upon error, but rather return the istream with appropriate flags set. It is then up to the caller to check the istream and produce diagnostics, if necessary.
In this case, it may be sufficient to just return "is", since it should already have the error flag set.
So perhaps just:
if(!(is >> p[i])){return is;}
9c4cbe2
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 had the same compile error on Mac OS at this point:
VisualSFM_OS_X_Installer-master/CMVS-PMVS-master/program/base/cmvs/../stann/dpoint.hpp:491:12: error:
no viable conversion from 'std::__1::locale' to 'char'
char errorpoint = is.getloc();
^ ~~~~~~~~~~~
1 error generated.
To fix this, I changed the code to the following from line 491:
if(!is.eof()){
//char errorpoint = is.getloc();
streampos errorpoint = is.tellg();
std::cerr << "Error Reading Point:"
<< errorpoint << std::endl;
exit(1);
}
9c4cbe2
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.
Hi Guys,
Having this same issue.
I tried to insert as indicated above, but when I save that line into the dpoint.hpp code, then reopen the code in xcode, the saved changes dissapear, and thus I keep getting the same error when I run the .sh
if(!is.eof()){
//char errorpoint = is.getloc();
streampos errorpoint = is.tellg();
std::cerr << "Error Reading Point:"
<< errorpoint << std::endl;
exit(1);
}
Any insight?