-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
string_proxy don't know how to compare #191
Comments
BTW:
|
Similarly, String and string_proxy don't know how to compare: int findString(CharacterVector haystack, String needle) {
for (int i = 0; i < haystack.size(); ++i)
if (haystack[i] == needle)
return i;
return -1;
} |
Ok. So I took a look at this and fundamentally something needs to be defined. Specifically what it means for Strings and string_proxy to compare.
So this means that two So, to keep paradigms the same, any comparison between Additionally any comparison between So the question "what does string equality comparison mean?" needs to be answered before this issue can be addressed in a reasonable way. As an aside, for
|
This must have gotten fixed during one of the 0.11.* releases. Taking Romain's example from above and putting it into R> sourceCpp("/tmp/foo.cpp")
R> all_equal( c("a", "b"), c("a", "b") )
[1] TRUE
R> so I'll close this. |
Note that testing equality of the underlying pointers is not good enough as it fails to handle equal strings that have different encodings. |
I get this because of ambiguities because the
operator==( string_proxy, string_proxy )
is not defined.Could have used this in
dplyr
here:https://github.com/hadley/dplyr/blob/5fe733ced5cce12d03787ca2d350b1f75edf95ac/inst/include/dplyr/JoinFactorFactorVisitor_SameLevels.h#L13
instead I had to write the manual loop:
The text was updated successfully, but these errors were encountered: