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

Side by Side Diff: base/functional.h

Issue 2944523002: Improving flat containers interface. (Closed)
Patch Set: Review, round 3. Created 3 years, 5 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 namespace base {
12
13 // std::less<> from C++14.
14 // Needed for improved flat containers API.
15
16 struct less {
17 template <typename T, typename U>
18 constexpr auto operator()(T&& lhs, U&& rhs) const
vmpstr 2017/06/26 15:35:53 "bool operator(...) const", since std::less::opera
dyaroshev 2017/06/26 16:19:29 This is how std::less is defined http://en.cpprefe
vmpstr 2017/06/26 16:27:32 Oh interesting. I was just looking at general std:
19 -> decltype(std::forward<T>(lhs) < std::forward<U>(rhs)) {
20 return std::forward<T>(lhs) < std::forward<U>(rhs);
21 }
22
23 using is_transparent = int;
24 };
25
26 } // base
27
28 #endif // BASE_FUNCTIONAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698