This question on the object generator pattern got me thinking about ways to automate it.
Essentially, I want to automate the creation of functions like std::ma
That's exactly right. I would expect it to work. So I think that GCC is in error with rejecting that. FWIW:
#include
template class TemplateClass, typename... Args>
TemplateClass make(Args&&... args)
{
return TemplateClass(std::forward(args)...);
}
int main() {
make(1, 2);
}
// [js@HOST2 cpp]$ clang++ -std=c++0x main1.cpp
// [js@HOST2 cpp]$