You've got multiple return paths which return different types. You'll need to use template overloading, something along the lines of:
template <typename tn>
tn GetClipboardContents();
template <>
double GetClipboardContents<double>()
{
// Add double implementation here
}
template <>
int GetClipboardContents<int>()
{
// Add int implementation here
}
Repeat for other types