- add compile checker in cmake to detect charconv support status. - and expose macro for yycc to enable different part of charconv repectively to prevent duplicated defines.
17 lines
391 B
C++
17 lines
391 B
C++
#include <charconv>
|
|
|
|
int main(int argc, char **argv) {
|
|
char buffer[1024];
|
|
char* first = buffer;
|
|
char* last = first + sizeof(buffer);
|
|
|
|
{
|
|
float value = 0;
|
|
auto rv = std::to_chars(first, last, value, std::chars_format::general, 6);
|
|
}
|
|
{
|
|
double value = 0;
|
|
auto rv = std::to_chars(first, last, value, std::chars_format::general, 6);
|
|
}
|
|
}
|