static member template in template
От: Аноним  
Дата: 31.03.14 14:47
Оценка:
wtf?
результат программы, должно выводиться имя функции funcInit
а ничего не выводиться

> gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)


#include <stdio.h>

template <void (*Init)()>
struct CALL
{
        CALL() { Init(); }
};

void funcInit() { printf("%s\n", __FUNCTION__); }

template <void (*Init)()>
struct WrapCALL
{
        static CALL<Init> II;
};

template <void (*Init)()>
CALL<Init> WrapCALL<Init>::II;

int main()
{
        WrapCALL<&funcInit> tmp;
        return 0;
}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.