From be887d92696afdcf9ab15c89ee5bf6d10be62e96 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 8 Sep 2017 08:09:28 -0700 Subject: [PATCH] Replace internal::get with std::declval --- fmt/format.h | 7 +++---- fmt/ostream.h | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fmt/format.h b/fmt/format.h index 3d573282..5fb9611b 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -1046,9 +1046,6 @@ struct null {}; typedef char yes[1]; typedef char no[2]; -template -T &get(); - yes &convert(unsigned long long); no &convert(...); @@ -1073,7 +1070,9 @@ struct convert_to_int_impl2 { template struct convert_to_int { - enum { enable_conversion = sizeof(convert(get())) == sizeof(yes) }; + enum { + enable_conversion = sizeof(convert(std::declval())) == sizeof(yes) + }; enum { value = convert_to_int_impl2::value }; }; diff --git a/fmt/ostream.h b/fmt/ostream.h index e7e0b8e7..66af91b4 100644 --- a/fmt/ostream.h +++ b/fmt/ostream.h @@ -63,7 +63,8 @@ template struct convert_to_int_impl { // Convert to int only if T doesn't have an overloaded operator<<. enum { - value = sizeof(convert(get() << get())) == sizeof(no) + value = sizeof(convert(std::declval() << std::declval())) + == sizeof(no) }; };