you can't overload your way into compile errors, the template always picks up the 'miscellaneous'. you can only overload your way into alternate paths. the only way that could possibly work would be with something like this:
Code:
template<class T,class U>
class Conversion
{
typedef char Small;
class Big{char arr[2];};
static Small Test(U);
static Big Test(...);
static T& MakeT();
public:
enum
{
exists = sizeof(Test(MakeT()))==sizeof(Small)
};
};
template<typename T> void Serializer::pack(T& t)
{
static_assert(Conversion<T,int>::exists,"packed types must be POD");
}