Skip to content

Commit

Permalink
Fix library deprecation warning
Browse files Browse the repository at this point in the history
Since C++17, using template specialization 'std::allocator<void>' in any shape or form (even just mentioning it) is deprecated! A simple workaround is replacing 'void' by another (preferably empty) type, e.g. 'fmt::monostate'.

Found by Clang 9 in Visual Studio.
  • Loading branch information
DanielaE authored and vitaut committed Feb 7, 2019
1 parent 9a0a24f commit 01f34d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/prepare-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,9 @@ template <typename T> struct user_allocator {
~user_allocator() = default;
template <typename U> user_allocator(const user_allocator<U>&) {}

pointer allocate(size_type cnt,
typename std::allocator<void>::const_pointer = FMT_NULL) {
pointer allocate(
size_type cnt,
typename std::allocator<fmt::monostate>::const_pointer = FMT_NULL) {
return new value_type[cnt];
}

Expand Down

0 comments on commit 01f34d0

Please sign in to comment.