Avoiding narrowing conversions with C++ type_traits
<p>I have a number of places in which I wish to use std::enable_if certain templates only if simple static cast from template type A to template type B (both of which are numeric) will not result in any loss of data.   However I am not sure what existing type_traits, if any, I should use or if I should write my own.</p>

<p>For example, casting from uint16_t to uint32_t, from float to double, even from int to double is not going to lose any precision or negative sign.  But casting from double to int  or int to uint32_t would obviously be problematic.</p>

<p>I've monkeyed around a bit, testing is_trivially_constructible, is_assignable, is_constructible, etc etc. but I don't see one that will warn me if I try to go from float to int.</p>

<p>Am I missing something that's in the library currently or should I just write it myself?</p>

<p>(I already know how to write it.  It's simple.  Just want to make sure I don't reinvent the wheel).</p>