Drake
scalar_predicate< T > Struct Template Reference

Detailed Description

template<typename T>
struct drake::scalar_predicate< T >

A traits struct that describes the return type of predicates over a scalar type (named T).

For example, a predicate that evaluates doubles will return a bool, but a predicate that evaluates symbolic::Expression will return a symbolic::Formula. By default, the return type is inferred from the type's comparison operator, but scalar types are permitted to specialize this template for their needs.

#include <drake/common/drake_bool.h>

Public Types

using type = decltype(T()< T())
 The return type of predicates over T. More...
 

Static Public Attributes

static constexpr bool is_bool = std::is_same_v<type, bool>
 Whether type is bool. More...
 

Member Typedef Documentation

◆ type

using type = decltype(T() < T())

The return type of predicates over T.

Member Data Documentation

◆ is_bool

constexpr bool is_bool = std::is_same_v<type, bool>
static

Whether type is bool.


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