* @brief Detect the C++ standard library used to compile this program. * * @return A string describing the C++ standard library. */
| 648 | * @return A string describing the C++ standard library. |
| 649 | */ |
| 650 | std::string detect_lib() |
| 651 | { |
| 652 | #if defined(_LIBCPP_VERSION) |
| 653 | return make_string("LLVM libc++ v", _LIBCPP_VERSION / 10000, '.', (_LIBCPP_VERSION / 100) % 100, '.', _LIBCPP_VERSION % 100); // NOLINT(readability-magic-numbers) |
| 654 | #elif defined(_GLIBCXX_RELEASE) |
| 655 | std::string out = make_string("GNU libstdc++ v", _GLIBCXX_RELEASE); |
| 656 | #ifdef __GLIBCXX__ |
| 657 | out += make_string(" (", __GLIBCXX__, ')'); |
| 658 | #endif |
| 659 | return out; |
| 660 | #elif defined(_MSVC_STL_VERSION) |
| 661 | std::string out = make_string("Microsoft STL v", _MSVC_STL_VERSION); |
| 662 | #ifdef _MSVC_STL_UPDATE |
| 663 | out += make_string(" (", _MSVC_STL_UPDATE, ')'); |
| 664 | #endif |
| 665 | return out; |
| 666 | #else |
| 667 | return "Other"; |
| 668 | #endif |
| 669 | } |
| 670 | |
| 671 | /** |
| 672 | * @brief Detect the operating system used to compile this program. |
no test coverage detected