From 5f774c0aed4af6494b412cd3883e0f09295bd79d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 2 Aug 2022 15:49:41 -0700 Subject: [PATCH] I shouldn't be there --- include/fmt/core.h | 6 +++--- test/core-test.cc | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 23d2565e..467fdb86 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -935,11 +935,11 @@ template class buffer { /** Appends data to the end of the buffer. */ template void append(const U* begin, const U* end); - template FMT_CONSTEXPR auto operator[](I index) -> T& { + template FMT_CONSTEXPR auto operator[](Idx index) -> T& { return ptr_[index]; } - template - FMT_CONSTEXPR auto operator[](I index) const -> const T& { + template + FMT_CONSTEXPR auto operator[](Idx index) const -> const T& { return ptr_[index]; } }; diff --git a/test/core-test.cc b/test/core-test.cc index 96cde1ed..c76dc161 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -9,7 +9,9 @@ #include "test-assert.h" // clang-format on +#define I 42 // simulate https://en.cppreference.com/w/c/numeric/complex/I #include "fmt/core.h" +#undef I #include // std::copy_n #include // INT_MAX