Skip to content

Commit

Permalink
I shouldn't be there
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Aug 2, 2022
1 parent 6567df7 commit 5f774c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,11 @@ template <typename T> class buffer {
/** Appends data to the end of the buffer. */
template <typename U> void append(const U* begin, const U* end);

template <typename I> FMT_CONSTEXPR auto operator[](I index) -> T& {
template <typename Idx> FMT_CONSTEXPR auto operator[](Idx index) -> T& {
return ptr_[index];
}
template <typename I>
FMT_CONSTEXPR auto operator[](I index) const -> const T& {
template <typename Idx>
FMT_CONSTEXPR auto operator[](Idx index) const -> const T& {
return ptr_[index];
}
};
Expand Down
2 changes: 2 additions & 0 deletions test/core-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm> // std::copy_n
#include <climits> // INT_MAX
Expand Down

0 comments on commit 5f774c0

Please sign in to comment.