1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/functional/not_fn.h"
9 #include "testing/gtest/include/gtest/gtest.h"
13 TEST(FunctionalTest, NotFn) {
14 constexpr auto not_less = base::not_fn(std::less<>());
16 using NotLessT = decltype(not_less);
17 static_assert(static_cast<const NotLessT&>(not_less)(1, 1), "");
18 static_assert(static_cast<NotLessT&>(not_less)(2, 1), "");
19 static_assert(static_cast<const NotLessT&&>(not_less)(2, 2), "");
20 static_assert(!static_cast<NotLessT&&>(not_less)(1, 2), "");