Disable std::format unless ENABLE_STD_FORMAT is defined. (#8178)

This commit is contained in:
MarcelPiNacy-CVC 2024-09-20 14:52:08 +02:00 committed by GitHub
parent 1417cc6617
commit 8f2fc098b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,8 @@
#include <Carla/Vehicle/CarlaWheeledVehicle.h>
#if __has_include(<format>)
// Clang 16 does not support C++20's std::format
#if defined(ENABLE_STD_FORMAT) && __has_include(<format>)
#define HAS_FORMAT
#include <format>
#endif
@ -32,7 +33,9 @@ requires (
std::remove_reference_t<V>::Dim <= 3)
static std::string FormatVectorLike(V&& v)
{
#ifndef HAS_FORMAT
char buffer[256];
#endif
constexpr auto Dim = std::remove_reference_t<V>::Dim;
if constexpr (Dim == 1)
{