Fix handling of empty tuples (#1588)

This commit is contained in:
Victor Zverovich
2020-03-14 07:41:08 -07:00
parent 02bfd8a9a5
commit 61c5a51604
2 changed files with 7 additions and 7 deletions

View File

@@ -13,6 +13,7 @@
#define FMT_RANGES_H_
#include <type_traits>
#include "format.h"
// output only up to N items from the range.
@@ -104,10 +105,7 @@ struct is_range_<
/// tuple_size and tuple_element check.
template <typename T> class is_tuple_like_ {
template <typename U>
static auto check(U* p)
-> decltype(std::tuple_size<U>::value,
(void)std::declval<typename std::tuple_element<0, U>::type>(),
int());
static auto check(U* p) -> decltype(std::tuple_size<U>::value, int());
template <typename> static void check(...);
public: