I have these overloaded functions which signature is:
// VERSION 1
template<typename Control, typename...Args>
auto addWidget( unsigned height, const Args&...arguments );
// VERSION 2
template<typename Control, typename...Args>
auto addWidget( string field_name, unsigned height, const Args&...arguments );
// NOW: version 2 calls VERSION 1 like so:
template<typename Control, typename...Args>
auto addWidget( string field_name, unsigned height, const Args&...arguments ) {
auto widget = addWidget( height, std::forward<const Args>(arguments)... );
// other stuff
return widget;
}
//// I am getting the following compiler warning:
/Users/juandent/Programs/C++/With Qt/sqlwidgetmapper/dialogcreator.h:94: error: no matching function for call to 'forward'
height, std::forward<const Args&...>(arguments...) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
WHAT IS GOING ON? I just want to perfect-forward the variable number of arguments received by both versions!!
Thanks,
Juan
auto widget = addWidget( associated_label, name, field_name,
x, y, width, height, std::forward<const Args&...>(arguments...) );