Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
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>
typename promoted_numerical< T, U >::type promoted_numerical_t
Definition mesh_traits.h:47
std::conditional_t< std::is_same_v< U, double >, T, U > type
Definition mesh_traits.h:43

#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

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

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