Rodousse / stbipp

A small size Image IO library based on stb_image. This has been archived due to a conflict of interest with my current employer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Color] Add some clear template parameters for SFINAE

Rodousse opened this issue · comments

Is your feature request related to a problem? Please describe.
The Color class uses a lot the SFINAE principle in maybe too verbose way

Describe the solution you'd like
Make some type traits that are meaningful to the developer such as :

template<class DataType, class ODataType>
struct is_float_to_integer_cast
{
    static const bool value = (std::is_floating_point<DataType>::value && std::is_integral<ODataType>::value) &&
                              !std::is_same<DataType, ODataType>::value;
};