From b102ae6d6ea778f28d4213b5b886dcb51a9b0fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 19 Jul 2022 22:13:16 +0200 Subject: Use std::declval. This is equivalent, but it may be useful to highlight that `args' does not HAVE to be declared in order to get the return type of the function call. --- c/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c/common.h') diff --git a/c/common.h b/c/common.h index efaa800..7d3f8bd 100644 --- a/c/common.h +++ b/c/common.h @@ -66,7 +66,7 @@ inline auto throw_nil(T... args) template inline auto warn_nil(T... args) { - decltype(f(args...)) r; + decltype(f(std::declval()...)) r; try { r = throw_nil(args...); } catch (Win32Error& e) { -- cgit v1.2.3