M
mmomike
Why can't I do this:
enum
{
MY_INT, MY_DOUBLE
};
template<typename T, int N>
void foo(T xx)
{
struct
{
int type;
int size;
T data;
} bundle;
bundle.type = N;
bundle.size = sizeof(T);
bundle.data = xx;
// record_bundle((void*) &bundle);
}
template void foo<int, MY_INT>(int);
template void foo<double, MY_DOUBLE>(double);
main()
{
int i = 0;
double d = 3.14159;
foo(i);
foo(d);
}
enum
{
MY_INT, MY_DOUBLE
};
template<typename T, int N>
void foo(T xx)
{
struct
{
int type;
int size;
T data;
} bundle;
bundle.type = N;
bundle.size = sizeof(T);
bundle.data = xx;
// record_bundle((void*) &bundle);
}
template void foo<int, MY_INT>(int);
template void foo<double, MY_DOUBLE>(double);
main()
{
int i = 0;
double d = 3.14159;
foo(i);
foo(d);
}