mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-05 12:04:11 +02:00
Protect against overloaded comma operators in decltype
This commit is contained in:
committed by
Victor Zverovich
parent
467520e7a4
commit
430e6ac9b6
@@ -76,7 +76,7 @@ template <typename OutputIterator> void copy(char ch, OutputIterator out) {
|
||||
template <typename T> class is_like_std_string {
|
||||
template <typename U>
|
||||
static auto check(U* p)
|
||||
-> decltype(p->find('a'), p->length(), p->data(), int());
|
||||
-> decltype((void)p->find('a'), p->length(), (void)p->data(), int());
|
||||
template <typename> static void check(...);
|
||||
|
||||
public:
|
||||
@@ -106,7 +106,8 @@ template <typename T> class is_tuple_like_ {
|
||||
template <typename U>
|
||||
static auto check(U* p)
|
||||
-> decltype(std::tuple_size<U>::value,
|
||||
internal::declval<typename std::tuple_element<0, U>::type>(),
|
||||
(void)internal::declval<
|
||||
typename std::tuple_element<0, U>::type>(),
|
||||
int());
|
||||
template <typename> static void check(...);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user