Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人知道下面的宏吗?我用谷歌搜索了它,但找不到任何有用的东西。它有什么作用?
#define rt_SATURATE(sig,ll,ul) (((sig) >= (ul)) ? (ul) : (((sig) <= (ll)) ? (ll) : (sig)) )
它做了std::clamp所做的事情。
它“返回”限制在(下限)和(上限)sig给定的范围内。llul
sig
ll
ul
由于问题被标记为qt另一个替代方案做同样的事情但参数的顺序不同是qBound