Skip to content

Commit

Permalink
Move void_t to where it's used
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed May 18, 2020
1 parent 7aafa6b commit 8d78045
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ namespace detail {
// warnings.
template <typename T> constexpr T const_check(T value) { return value; }

// A workaround for gcc 4.8 to make void_t work in a SFINAE context.
template <typename... Ts> struct void_t_impl { using type = void; };

FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
const char* message);

Expand Down Expand Up @@ -342,9 +339,6 @@ enum char8_type : unsigned char {};

namespace internal = detail; // DEPRECATED

template <typename... Ts>
using void_t = typename detail::void_t_impl<Ts...>::type;

/**
An implementation of ``std::basic_string_view`` for pre-C++17. It provides a
subset of the API. ``fmt::basic_string_view`` is used for format strings even
Expand Down
7 changes: 7 additions & 0 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ template <> constexpr int num_bits<fallback_uintptr>() {
std::numeric_limits<unsigned char>::digits);
}


// A workaround for gcc 4.8 to make void_t work in a SFINAE context.
template <typename... Ts> struct void_t_impl { using type = void; };

template <typename... Ts>
using void_t = typename detail::void_t_impl<Ts...>::type;

// An approximation of iterator_t for pre-C++20 systems.
template <typename T>
using iterator_t = decltype(std::begin(std::declval<T&>()));
Expand Down

0 comments on commit 8d78045

Please sign in to comment.