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

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

Issue 1129793005: Replace OwnPtr with WTF::Optional for optional recorders. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge with master Created 5 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 | Annotate | Revision Log
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 static_assert((IsSameType<bool, RemoveConstVolatile<const bool>::Type>::value), "RemoveConstVolatile should remove const-ness"); 216 static_assert((IsSameType<bool, RemoveConstVolatile<const bool>::Type>::value), "RemoveConstVolatile should remove const-ness");
217 static_assert((IsSameType<bool, RemoveConstVolatile<volatile bool>::Type>::value ), "RemoveConstVolatile should remove volatility"); 217 static_assert((IsSameType<bool, RemoveConstVolatile<volatile bool>::Type>::value ), "RemoveConstVolatile should remove volatility");
218 static_assert((IsSameType<bool, RemoveConstVolatile<const volatile bool>::Type>: :value), "RemoveConstVolatile should remove both constness and volatility"); 218 static_assert((IsSameType<bool, RemoveConstVolatile<const volatile bool>::Type>: :value), "RemoveConstVolatile should remove both constness and volatility");
219 219
220 static_assert((IsSameType<int, RemovePointer<int>::Type>::value), "RemovePointer should not modify non-pointer types"); 220 static_assert((IsSameType<int, RemovePointer<int>::Type>::value), "RemovePointer should not modify non-pointer types");
221 static_assert((IsSameType<int, RemovePointer<int*>::Type>::value), "RemovePointe r should produce the corresponding non-pointer type"); 221 static_assert((IsSameType<int, RemovePointer<int*>::Type>::value), "RemovePointe r should produce the corresponding non-pointer type");
222 static_assert((!IsSameType<int, RemovePointer<int**>::Type>::value), "RemovePoin ter should only remove one pointer level"); 222 static_assert((!IsSameType<int, RemovePointer<int**>::Type>::value), "RemovePoin ter should only remove one pointer level");
223 223
224 static_assert((IsSameType<int, RemoveReference<int>::Type>::value), "RemoveRefer ence should not modify non-reference types"); 224 static_assert((IsSameType<int, RemoveReference<int>::Type>::value), "RemoveRefer ence should not modify non-reference types");
225 static_assert((IsSameType<int, RemoveReference<int&>::Type>::value), "RemoveRefe rence should produce the corresponding non-reference type"); 225 static_assert((IsSameType<int, RemoveReference<int&>::Type>::value), "RemoveRefe rence should produce the corresponding non-reference type");
226 static_assert((IsSameType<int, RemoveReference<int&&>::Type>::value), "RemoveRef erence should produce the corresponding non-reference type");
226 227
227 228
228 typedef int IntArray[]; 229 typedef int IntArray[];
229 typedef int IntArraySized[4]; 230 typedef int IntArraySized[4];
230 231
231 static_assert((IsArray<IntArray>::value), "IsArray should recognize arrays"); 232 static_assert((IsArray<IntArray>::value), "IsArray should recognize arrays");
232 static_assert((IsArray<IntArraySized>::value), "IsArray should recognize sized a rrays"); 233 static_assert((IsArray<IntArraySized>::value), "IsArray should recognize sized a rrays");
233 234
234 static_assert((IsSameType<int, RemoveExtent<IntArray>::Type>::value), "RemoveExt ent should return the array element type of an array"); 235 static_assert((IsSameType<int, RemoveExtent<IntArray>::Type>::value), "RemoveExt ent should return the array element type of an array");
235 static_assert((IsSameType<int, RemoveExtent<IntArraySized>::Type>::value), "Remo veExtent should return the array element type of a sized array"); 236 static_assert((IsSameType<int, RemoveExtent<IntArraySized>::Type>::value), "Remo veExtent should return the array element type of a sized array");
236 237
237 } // namespace WTF 238 } // namespace WTF
OLDNEW
« Source/wtf/Optional.h ('K') | « Source/wtf/TypeTraits.h ('k') | Source/wtf/Utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698