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

Side by Side Diff: Source/wtf/TypeTraits.h

Issue 802203004: replace COMPILE_ASSERT with static assert in wtf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: final fixups Created 6 years 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
« no previous file with comments | « Source/wtf/StringHasher.h ('k') | Source/wtf/TypeTraits.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 25 matching lines...) Expand all
36 // 36 //
37 // IsSameType<T, U>::value 37 // IsSameType<T, U>::value
38 // 38 //
39 // RemovePointer<T>::Type 39 // RemovePointer<T>::Type
40 // RemoveReference<T>::Type 40 // RemoveReference<T>::Type
41 // RemoveConst<T>::Type 41 // RemoveConst<T>::Type
42 // RemoveVolatile<T>::Type 42 // RemoveVolatile<T>::Type
43 // RemoveConstVolatile<T>::Type 43 // RemoveConstVolatile<T>::Type
44 // RemoveExtent<T>::Type 44 // RemoveExtent<T>::Type
45 // 45 //
46 // COMPILE_ASSERT's in TypeTraits.cpp illustrate their usage and what they do. 46 // static_assert's in TypeTraits.cpp illustrate their usage and what they do.
47 47
48 template<bool Predicate, class T = void> struct EnableIf; 48 template<bool Predicate, class T = void> struct EnableIf;
49 template<class T> struct EnableIf<true, T> { typedef T Type; }; 49 template<class T> struct EnableIf<true, T> { typedef T Type; };
50 50
51 template<typename T> struct IsInteger { static const bool value = false; }; 51 template<typename T> struct IsInteger { static const bool value = false; };
52 template<> struct IsInteger<bool> { static const bool value = true; }; 52 template<> struct IsInteger<bool> { static const bool value = true; };
53 template<> struct IsInteger<char> { static const bool value = true; }; 53 template<> struct IsInteger<char> { static const bool value = true; };
54 template<> struct IsInteger<signed char> { static const bool value = true; }; 54 template<> struct IsInteger<signed char> { static const bool value = true; };
55 template<> struct IsInteger<unsigned char> { static const bool value = true; }; 55 template<> struct IsInteger<unsigned char> { static const bool value = true; };
56 template<> struct IsInteger<short> { static const bool value = true; }; 56 template<> struct IsInteger<short> { static const bool value = true; };
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 }; 346 };
347 347
348 template<typename T, typename U> 348 template<typename T, typename U>
349 struct NeedsTracing<std::pair<T, U> > { 349 struct NeedsTracing<std::pair<T, U> > {
350 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value | | IsWeak<T>::value || IsWeak<U>::value; 350 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value | | IsWeak<T>::value || IsWeak<U>::value;
351 }; 351 };
352 352
353 } // namespace WTF 353 } // namespace WTF
354 354
355 #endif // TypeTraits_h 355 #endif // TypeTraits_h
OLDNEW
« no previous file with comments | « Source/wtf/StringHasher.h ('k') | Source/wtf/TypeTraits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698