your solution is fine and i hope you know that instead of std::enable_if you could use template helper class with specializations.