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

Side by Side Diff: third_party/libcxx/include/ext/__hash

Issue 75213003: Add libc++ and libc++abi to third-party. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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 // -*- C++ -*-
2 //===------------------------- hash_set ------------------------------------===/ /
3 //
4 // The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef _LIBCPP_EXT_HASH
12 #define _LIBCPP_EXT_HASH
13
14 #pragma GCC system_header
15
16 #include <string>
17 #include <cstring>
18
19 namespace __gnu_cxx {
20 using namespace std;
21
22 template <typename T> struct _LIBCPP_TYPE_VIS_ONLY hash : public std::hash<T>
23 { };
24
25 template <> struct _LIBCPP_TYPE_VIS_ONLY hash<const char*>
26 : public unary_function<const char*, size_t>
27 {
28 _LIBCPP_INLINE_VISIBILITY
29 size_t operator()(const char *__c) const _NOEXCEPT
30 {
31 return __do_string_hash(__c, __c + strlen(__c));
32 }
33 };
34
35 template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char *>
36 : public unary_function<char*, size_t>
37 {
38 _LIBCPP_INLINE_VISIBILITY
39 size_t operator()(char *__c) const _NOEXCEPT
40 {
41 return __do_string_hash<const char *>(__c, __c + strlen(__c));
42 }
43 };
44 }
45
46 #endif // _LIBCPP_EXT_HASH
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698