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
#include <iostream>
#include <string_view>
#include <cstdio>
#include <scn/scn.h>
int main()
{
const char* s = "+12345";
std::string_view sv( s );
double x;
auto r = scn::scan( sv, "{}", x );
if ( r ) std::cout << "scn: got: " << x << "\n";
else std::cout << "scn: error: '" << r.error().msg() << "'\n";
if ( sscanf( s, "%lf", &x ) == 1 ) std::cout << "scanf: got: " << x << "\n";
else std::cout << "scanf: error\n";
return 0;
}
yields:
scn: error: 'fast_float'
scanf: got: 12345
IMO this should work and return 12345. It's also a bit annoying that the error message just says "fast_float" instead of indicating what the problem is. Obviously I can guess what the problem is but when this is embedded in a larger application the user will have no idea what fast_float means.
The text was updated successfully, but these errors were encountered:
Is there any chance the error message could be improved? I'd be happy to help but the level of template programming used is more than I'm used to at least without some direction.
Version 1.1.2
yields:
IMO this should work and return 12345. It's also a bit annoying that the error message just says "fast_float" instead of indicating what the problem is. Obviously I can guess what the problem is but when this is embedded in a larger application the user will have no idea what fast_float means.
The text was updated successfully, but these errors were encountered: