add array.h/cpp
This commit is contained in:
7
cmake/check-from_chars.cmake
Normal file
7
cmake/check-from_chars.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
message(STATUS "Checking that std::from_chars for floats is supported by the C++ library")
|
||||
try_compile(FROM_CHARS_WORKS "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_LIST_DIR}/check-from_chars.cpp")
|
||||
if(FROM_CHARS_WORKS)
|
||||
message(STATUS "Checking that std::from_chars for floats is supported by the C++ library - yes")
|
||||
else()
|
||||
message(STATUS "Checking that std::from_chars for floats is supported by the C++ library - NO")
|
||||
endif()
|
||||
8
cmake/check-from_chars.cpp
Normal file
8
cmake/check-from_chars.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <charconv>
|
||||
|
||||
int main()
|
||||
{
|
||||
const char str[] = "1.2345e3";
|
||||
float num;
|
||||
std::from_chars(str, str + sizeof str - 1, num);
|
||||
}
|
||||
Reference in New Issue
Block a user