Drake
Drake C++ Documentation
promoted_numerical< T, U > Struct Template Reference

Detailed Description

template<typename T, typename U>
struct drake::geometry::promoted_numerical< T, U >

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:

template <typename T, typename U>

#include <drake/geometry/proximity/mesh_traits.h>

Public Types

using type = std::conditional_t< std::is_same_v< U, double >, T, U >
 

Member Typedef Documentation

◆ type

using type = std::conditional_t<std::is_same_v<U, double>, T, U>

The documentation for this struct was generated from the following file: