Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: base/functional.h

Issue 2944523002: Improving flat containers interface. (Closed)
Patch Set: Review, round 1. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_FUNCTIONAL_H_
6 #define BASE_FUNCTIONAL_H_
7
8 #include <functional>
9 #include <utility>
10
11 #include "base/type_traits.h"
12
13 namespace base {
14
15 // std::less<> from C++14.
16 // Needed for improved flat containers API.
17
18 struct less {
19 template <typename T, typename U>
20 constexpr auto operator()(T&& lhs, U&& rhs) const
21 -> decltype(std::forward<T>(lhs) < std::forward<U>(rhs)) {
22 return std::forward<T>(lhs) < std::forward<U>(rhs);
23 }
24
25 using is_transparent = int;
26 };
27
28 } // base
29
30 #endif // BASE_FUNCTIONAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698