Is there a way to specify that a particular template should only work for certain types?

Reason: I'm working on expanding my socket class to handle input. The code for converting from characters to float and characters to doubles is exactly the same save the type.

Just doing some musing to try and save myself some typing