Drake
Traits< S > Struct Template Reference

A templated traits class for whether an S<T> can be converted into an S<U>; the default value is true for all values of S, T, and U. More...

#include <drake/systems/framework/scalar_conversion_traits.h>

Public Types

template<typename T , typename U >
using supported = std::true_type
 

Detailed Description

template<template< typename > class S>
struct drake::systems::scalar_conversion::Traits< S >

A templated traits class for whether an S<T> can be converted into an S<U>; 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:

template <typename T>
class Foo {
template <typename U>
explicit Foo(const Foo<U>& other);
};

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.

Template Parameters
Sis the scalar-templated type to copy

Member Typedef Documentation

using supported = std::true_type
Template Parameters
Tis the resulting scalar type (to convert into)
Uis the donor scalar type (to convert from)

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