Provides a strict weak ordering on variables (see less), for use as the comparator of an ordered container, e.g., std::set<Variable, Variable::CompareLess>.
Note that std::less<Variable> must not be used for this purpose: the C++ standard requires it to be equivalent to operator<, which for Variable constructs a symbolic Formula instead of returning a bool. (For backwards compatibility, on platforms other than libc++ >= 22 this is currently an alias of the deprecated std::less<Variable> specialization; it will become a distinct type on all platforms on or after 2027-02-01.)
#include <drake/common/symbolic/expression/variable.h>
Public Member Functions | |
| bool | operator() (const Variable &lhs, const Variable &rhs) const |