A templated traits class for whether an S<U>
can be converted into an S<T>
; the default value is true for all values of S
, T
, and U
.
Particular scalar-dependent classes (S
) may specialize this template to indicate whether the framework should support conversion for any given combination of T
and U
.
When Traits<S>::supported<T, U>
is std::true_type
, the "scalar-converting copy constructor" that relates S
, T
, and U
will be used. That constructor takes the form of, e.g., when S
is Foo
:
See System Scalar Conversion for detailed background and examples related to scalar-type conversion support.
When Traits<S>::supported<T, U>
is std::false_type
, the S<T>::S(const S<U>&)
scalar-conversion copy constructor will not even be mentioned by the framework, so that S
need not even compile for certain values of T
and U
.
S | is the scalar-templated type to copy |
#include <drake/systems/framework/scalar_conversion_traits.h>
Public Types | |
template<typename T , typename U > | |
using | supported = std::true_type |
using supported = std::true_type |
T | is the resulting scalar type (to convert into) |
U | is the donor scalar type (to convert from) |