我收到以下代码的 SFINAE 错误,因为它不会使用模板。结果,我正在尝试完善 args 。任何想法任何人。
#include <iostream>
#include "constants.h"
namespace perfectforwarding
{
template<class T, class U>
constexpr auto maximum(T&& a, U&& b) -> decltype( (a > b) ? std::forward(a) : std::forward(b))
{
return (a > b) ? std::forward(a) : std::forward(b);
}
}
int main(int argc, const char * argv[])
{
std::cout << "Created count is: " << created_count << std::endl;
auto const result = perfectforwarding::maximum(5,6.0);
std::cout << "The maximum of 5 and 6: " << result << std::endl;
return 0;
}
布莱尔