mirror of
https://github.com/PDB-REDO/libcifpp.git
synced 2026-06-04 13:54:25 +08:00
17 lines
246 B
C++
17 lines
246 B
C++
#include <charconv>
|
|
#include <cassert>
|
|
#include <cstring>
|
|
|
|
int main()
|
|
{
|
|
float v;
|
|
char s[] = "1.0";
|
|
|
|
auto r = std::from_chars(s, s + strlen(s), v);
|
|
|
|
assert(r.ec == std::errc{});
|
|
assert(r.ptr = s + strlen(s));
|
|
assert(v == 1.0f);
|
|
|
|
return 0;
|
|
} |