Given the two scalar types U and T, returns the most "promoted" type.
The scalars must be either double
or AutoDiffXd
.
This trait implicitly encodes the logic: if either B or T are AutoDiffXd, return AutoDiffXd. The logic is illustrated with this truth table:
T | U | Result |
---|---|---|
AutoDiffXd | AutoDiffXd | AutoDiffXd |
double | AutoDiffXd | AutoDiffXd |
AutoDiffXd | double | AutoDiffXd |
double | double | double |
This also includes the helper type:
#include <drake/geometry/proximity/mesh_traits.h>
Public Types | |
using | type = std::conditional_t< std::is_same_v< U, double >, T, U > |