J
JKop
The following compiles:
#include <iostream>
using std::cout;
using std::endl;
template< class T >
struct DisplayFormat
{
unsigned char radix;
const T* digits;
T decimal_point_symbol;
unsigned char digits_after_decimal_point;
T comma_symbol;
unsigned char digits_until_comma;
};
DisplayFormat<wchar_t> us_display_format =
{ 10 , L"0123456789" , L'.' , 2 , L',' , 3 };
template < DisplayFormat < wchar_t > * df> //THIS LINE
inline void Blah()
{
cout << df->digits << endl;
}
int main()
{
Blah<&us_display_format>();
}
Where I'm having trouble is "THIS LINE". How do I turn:
template < DisplayFormat < wchar_t > * df>
into:
template < template < class T > DisplayFormat < T > * df >
Obviously I've tried the above, but it won't compile.
-JKop
#include <iostream>
using std::cout;
using std::endl;
template< class T >
struct DisplayFormat
{
unsigned char radix;
const T* digits;
T decimal_point_symbol;
unsigned char digits_after_decimal_point;
T comma_symbol;
unsigned char digits_until_comma;
};
DisplayFormat<wchar_t> us_display_format =
{ 10 , L"0123456789" , L'.' , 2 , L',' , 3 };
template < DisplayFormat < wchar_t > * df> //THIS LINE
inline void Blah()
{
cout << df->digits << endl;
}
int main()
{
Blah<&us_display_format>();
}
Where I'm having trouble is "THIS LINE". How do I turn:
template < DisplayFormat < wchar_t > * df>
into:
template < template < class T > DisplayFormat < T > * df >
Obviously I've tried the above, but it won't compile.
-JKop