I was reading this question and some other stuff : Are there cases where a typedef is absolutely necessary??
I wrote this code :
const int arrayOfInt[10] = {0};
template<typename T, int N> using X = const T (&)[N];
struct foo
{
template<typename T, int N> operator X<int,10> () { return arrayOfInt; }
};
void bar(const int (&) [10]) {}
int main()
{
bar(foo());
return 0;
}
using
feature of c++11 is not working for me , also I'm unable to think how to typedef
the return type in this case too since my class foo
is not template itself. I need to see solution using using
keyword and typedef
both . Thanks a lot awesome peoples of SO :)