<div dir="ltr">Hi All,<div><br></div><div style>I'm trying to compile a C++ project with Clang. It compiles with gcc without error, but Clang breaks. Unfortunately could not simplify further and has 'boost' as dependency. I need some help.</div>
<div style><br></div><div style>How can I change the code to compile with clang? And if it is a not expected behavior of Clang, what could be an error report for this?</div><div style><br></div><div style>Thanks,</div><div style>
Laszlo</div><div style><br></div><div style><br></div><div style><div>$ clang++ -c test.cpp </div><div>test.cpp:9:64: error: no matching function for call to 'ref'</div><div>        std::for_each(v.begin(), v.end(), boost::bind(&S::bar, boost::ref(this), _1));</div>
<div>                                                               ^~~~~~~~~~</div><div>/usr/include/boost/ref.hpp:64:63: note: candidate function [with T = S *] not viable: no known conversion from 'S *' to 'S *&' for 1st argument</div>
<div>template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)</div><div>                                                              ^</div><div>1 error generated.</div></div></div>