Hi,
Trying to compile the following code:
#include <iostream>
using namespace std;
template<void (*F)()> void SetCallback(){
F();
}
static void Foo() {
struct stub_t {
static void cb(){
cout << "Foo::stub_t::cb()"<< endl;
}
};
SetCallback<&stub_t::cb>();
}
void TemplateInstantiation() {
Foo();
}
I get this error: "(18): error : a template argument may not reference a non-external entity".
But I can't find any restrictions on template arguments in c++11 specification, at least in draft n3376, that can explain why this is wrong.
Is there something that I have been missed? Or this is specific of the compiler?
I'm using Intel® C++ Composer XE 2015.