Checks structural equality of variables (see equal_to), for use as the key-equality predicate of an unordered container, e.g., std::unordered_set<Variable, std::hash<Variable>, Variable::CompareEqualTo>.
Note that std::equal_to<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::equal_to<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 |