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
Using the std::max_element() algorithm on a writable vector results in a compile error. The error is not present when using a non-writable vector. It is speculated that the following commit made it possible on the standard vectors and need to be applied to the writable versions as well: 686ae04
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/max_element.h:34:25: error: object of type 'cpp11::writable::r_vector<double>::iterator' cannot be assigned because its copy assignment operator is implicitly deleted
__first = __i;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/max_element.h:44:19: note: in instantiation of function template specialization 'std::__max_element<std::__less<cpp11::writable::r_vector<double>::proxy> &, cpp11::writable::r_vector<double>::iterator>' requested here
return _VSTD::__max_element<_Comp_ref>(__first, __last, __comp);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/max_element.h:52:19: note: in instantiation of function template specialization 'std::max_element<cpp11::writable::r_vector<double>::iterator, std::__less<cpp11::writable::r_vector<double>::proxy>>' requested here
return _VSTD::max_element(__first, __last,
^
code.cpp:4:8: note: in instantiation of function template specialization 'std::max_element<cpp11::writable::r_vector<double>::iterator>' requested here
std::max_element(foo.begin(), foo.end());
^
/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/cpp11/include/cpp11/r_vector.hpp:259:21: note: copy assignment operator of 'iterator' is implicitly deleted because field 'data_' is of reference type 'const cpp11::writable::r_vector<double> &'
const r_vector& data_;
^
1 error generated.
Using the
std::max_element()
algorithm on a writable vector results in a compile error. The error is not present when using a non-writable vector. It is speculated that the following commit made it possible on the standard vectors and need to be applied to the writable versions as well: 686ae04Compiling the above yields the following error:
Whereas this compiles fine
The text was updated successfully, but these errors were encountered: