Skip to content

signed chars are not converted to str: is this intentional? #4235

Answered by Skylion007
YangJiao1996 asked this question in Q&A
Discussion options

You must be logged in to vote

We never designed any of the casters with the intent of using signed chars. You can always do a conversion of the return value to unsigned chars with a lambda or function wrapper. The fact that unsigned chars gets cast to anything at all is surprising, it seems they are implicitly convertible to int which is why they work at all: https://en.cppreference.com/w/cpp/language/implicit_conversion

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@YangJiao1996
Comment options

Answer selected by YangJiao1996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants