考虑两个函数调用
foo({"a", 1}, {"b", "value"});
foo({"a", 1}, {"b", "value"}, {"c", 1.0});
Run Code Online (Sandbox Code Playgroud)
有没有办法foo为任意数量的参数对编写函数?
我正在思考一些问题
template <typename... Args>
void foo(std::pair<const char*, Args>&&...);
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用.
gcc因错误而失败:
error: too many arguments to function 'void foo(std::pair<const char*, Args>&& ...) [with Args = {}]'
foo({"aa", 1});
Run Code Online (Sandbox Code Playgroud) c++ templates variadic-templates template-argument-deduction c++14
如何获得 QDateEdit 的外观,如图所示?

我尝试更改样式表,但我不知道如何实现按钮和编辑之间的间距,也不知道如何更改向下箭头按钮。