File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 77namespace nv {
88
99// Logical operators
10- struct LogicalNot { template <typename T> T operator ()(T t) const { return !t; } };
11- struct LogicalAnd { template <typename T> T operator ()(T lhs, T rhs) const { return lhs && rhs; } };
12- struct LogicalOr { template <typename T> T operator ()(T lhs, T rhs) const { return lhs || rhs; } };
10+ struct Not { template <typename T> T operator ()(T t) const { return !t; } };
11+ struct And { template <typename T> T operator ()(T lhs, T rhs) const { return lhs && rhs; } };
12+ struct Or { template <typename T> T operator ()(T lhs, T rhs) const { return lhs || rhs; } };
1313
1414// unary ops, which are both: (1) a tag which represents the operation and (2) the implementation of that operation
1515struct Identity { template <typename T> T operator ()(T t) const { return t; } };
Original file line number Diff line number Diff line change 33
44namespace {
55
6- TEST (functional, logical_not )
6+ TEST (functional, not )
77{
8- const auto f = nv::LogicalNot {};
8+ const auto f = nv::Not {};
99 EXPECT_EQ (f (false ), true );
1010}
1111
12- TEST (functional, logical_and )
12+ TEST (functional, and )
1313{
14- const auto f = nv::LogicalAnd {};
14+ const auto f = nv::And {};
1515 EXPECT_EQ (f (false , true ), false );
1616}
1717
18- TEST (functional, logical_or )
18+ TEST (functional, or )
1919{
20- const auto f = nv::LogicalOr {};
20+ const auto f = nv::Or {};
2121 EXPECT_EQ (f (false , true ), true );
2222}
2323
You can’t perform that action at this time.
0 commit comments