Which of the following ways of declaring a function template that takes a structure T as a parameter are syntactically correct?
//1:
template < typename T, int T::member >
void some_function() {}

//2:
template < class T, int *T::member >
void some_function() {}

//3:
template < typename T, int &T::member >
void some_function() {}

//4:
template < class T, int T::*member >
void some_function() {}

//5:
template < typename T, int T::&member >
void some_function()
{}
Explanation
Get an explanation when it's available:

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты