-
Notifications
You must be signed in to change notification settings - Fork 31
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
Construction from Constexpr StringView #398
Comments
It wouldn't be a good design choice to inject a dependency on And as this seems to be a literal value, perhaps a UDL would work, e.g.: constexpr static uintwide_t<65535, std::uint64_t> BIG_INT_CONSTANT {0xA0A0A0000000000000000000000_wide_integer}; |
Yes, but I agree with John (@johnmcfarlane), who indicates, ...
There is already a constructor from I think it owuld be best if we were to discuss either a factory-like non-member function or something like what John sketheced out above. |
Since that constructor is already there, would it be a fair compromise to add a second, default-set length parameter which could handle string-view (which is non-null-terminated). Could this be a reasonable solution? Cc: @larkwiot and @johnmcfarlane |
Thanks for your guys' time on this! I personally don't have a preference on the implementation of this, I just like the library and wanted to have some global constants. Of the solutions mentioned so far, a utility function like |
I appreciate this. There is, however, a special case to handle. When dealing with Personally, I do not like creating an Let me put together a draft and present it in a future PR. |
Hopefully there's a generic way to handle both It might be a little trickier to wrap your head around if you're not used to dealing with iterators and templates as much as indexes and |
Of course @johnmcfarlane, I can/will implement (it in a hopefully nice and non-ambiguous way) with template-iterators |
Oh you know what? A while back, I implemented something that tries as best as possible to immitate I might as well implement now for this issue something that's close to |
Note to self: Implementation detail, ... the proposed |
See also #400 |
Hi @larkwiot and @johnmcfarlane
|
Fixes #398 via impl and test from_chars()
Hello,
Is there any way to construct directly from a StringView? Looking to have something like this in my code:
The text was updated successfully, but these errors were encountered: