From d6fd7106f23bf1442be8427efa6ca2d611bccf75 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 20 Jul 2017 23:14:26 +0200 Subject: options/tie: add overload with no format string --- options/tie.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/options/tie.hpp b/options/tie.hpp index 16bf51d4..dffc6306 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -58,11 +58,6 @@ void tie_setting(value& v, QLabel* lb, const QString& format, const xs&... ar v.SAFE_CONNTYPE); } -// Clang 3.9 has a bug -// error: missing default argument on parameter 'args' - -// cf. http://stackoverflow.com/questions/29098835/can-parameter-pack-function-arguments-be-defaulted - template decltype((void)((std::declval())(std::declval()))) tie_setting(value& v, QLabel* lb, F&& fun, const QString& fmt, const xs&... args) @@ -75,6 +70,13 @@ tie_setting(value& v, QLabel* lb, F&& fun, const QString& fmt, const xs&... a v.SAFE_CONNTYPE); } +template +decltype((void)((std::declval())(std::declval()))) +tie_setting(value& v, QLabel* lb, F&& fun) +{ + tie_setting(v, lb, fun, QStringLiteral("%1")); +} + OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb); OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb); OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb); -- cgit v1.2.3