Chromium Code Reviews| Index: base/functional.h |
| diff --git a/base/functional.h b/base/functional.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fc5e8a0a113fbc22e098536a8e0a92e110aeae80 |
| --- /dev/null |
| +++ b/base/functional.h |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
|
danakj
2017/06/26 19:33:12
Can this go in template_util.h? We haven't reprodu
dyaroshev
2017/06/26 22:40:42
Done
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_FUNCTIONAL_H_ |
| +#define BASE_FUNCTIONAL_H_ |
| + |
| +#include <functional> |
| +#include <utility> |
| + |
| +namespace base { |
| + |
| +// std::less<> from C++14. |
| +// Needed for improved flat containers API. |
|
danakj
2017/06/26 19:33:12
remove this line
dyaroshev
2017/06/26 22:40:42
Done.
|
| + |
| +struct less { |
| + template <typename T, typename U> |
| + constexpr auto operator()(T&& lhs, U&& rhs) const |
| + -> decltype(std::forward<T>(lhs) < std::forward<U>(rhs)) { |
| + return std::forward<T>(lhs) < std::forward<U>(rhs); |
| + } |
| + |
| + using is_transparent = int; |
|
danakj
2017/06/26 19:33:12
Refer to transparent docs here also please
dyaroshev
2017/06/26 22:40:42
Done
|
| +}; |
| + |
| +} // base |
|
danakj
2017/06/26 19:33:12
namespace base
dyaroshev
2017/06/26 22:40:42
Not applicable.
|
| + |
| +#endif // BASE_FUNCTIONAL_H_ |