added compile-time checks
SFINAE tricks applied to implicit conversion. Thanks to STL