diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-07-20 23:14:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-07-20 23:14:26 +0200 |
commit | d6fd7106f23bf1442be8427efa6ca2d611bccf75 (patch) | |
tree | d24342d4bbdfd807dd02e2d722c5c8d7845e1b82 /options/tie.hpp | |
parent | 83b474c4d084c27245a2b1a6790e371193caae3a (diff) |
options/tie: add overload with no format string
Diffstat (limited to 'options/tie.hpp')
-rw-r--r-- | options/tie.hpp | 12 |
1 files 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<t>& 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<typename t, typename F, typename... xs> decltype((void)((std::declval<F>())(std::declval<const t&>()))) tie_setting(value<t>& v, QLabel* lb, F&& fun, const QString& fmt, const xs&... args) @@ -75,6 +70,13 @@ tie_setting(value<t>& v, QLabel* lb, F&& fun, const QString& fmt, const xs&... a v.SAFE_CONNTYPE); } +template<typename t, typename F, typename... xs> +decltype((void)((std::declval<F>())(std::declval<const t&>()))) +tie_setting(value<t>& v, QLabel* lb, F&& fun) +{ + tie_setting(v, lb, fun, QStringLiteral("%1")); +} + OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb); OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb); OTR_OPTIONS_EXPORT void tie_setting(value<QVariant>& v, QComboBox* cb); |