diff --git a/test/pixel.cpp b/test/pixel.cpp index b6e333c71..55cc096dc 100644 --- a/test/pixel.cpp +++ b/test/pixel.cpp @@ -27,10 +27,17 @@ void error_if(bool condition); struct increment { template void operator()(Incrementable& x) const { ++x; } }; -struct prev { + +struct prev +{ template - typename channel_traits::value_type operator()(const Subtractable& x) const { return x-1; } + auto operator()(const Subtractable& x) const -> typename channel_traits::value_type + { + using return_type = typename channel_traits::value_type; + return static_cast(x - 1); + } }; + struct set_to_one{ int operator()() const { return 1; } }; // Construct with two pixel types. They must be compatible and the second must be mutable