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

Side by Side Diff: base/template_util_unittest.cc

Issue 2000043002: Make base::Optional trivially destructible when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« base/template_util.h ('K') | « base/template_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/template_util.h" 5 #include "base/template_util.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace base { 9 namespace base {
10 namespace { 10 namespace {
(...skipping 30 matching lines...) Expand all
41 AssignNoMove& operator=(const AssignNoMove&) = delete; 41 AssignNoMove& operator=(const AssignNoMove&) = delete;
42 }; 42 };
43 43
44 static_assert(is_copy_assignable<AssignCopy>::value, "IsCopyAssignable"); 44 static_assert(is_copy_assignable<AssignCopy>::value, "IsCopyAssignable");
45 static_assert(!is_copy_assignable<AssignNoCopy>::value, "IsCopyAssignable"); 45 static_assert(!is_copy_assignable<AssignNoCopy>::value, "IsCopyAssignable");
46 46
47 static_assert(is_move_assignable<AssignCopy>::value, "IsMoveAssignable"); 47 static_assert(is_move_assignable<AssignCopy>::value, "IsMoveAssignable");
48 static_assert(is_move_assignable<AssignNoCopy>::value, "IsMoveAssignable"); 48 static_assert(is_move_assignable<AssignNoCopy>::value, "IsMoveAssignable");
49 static_assert(!is_move_assignable<AssignNoMove>::value, "IsMoveAssignable"); 49 static_assert(!is_move_assignable<AssignNoMove>::value, "IsMoveAssignable");
50 50
51 struct TriviallyDestructible {
52 int field;
53 };
54
55 class NonTriviallyDestructible {
56 ~NonTriviallyDestructible() {}
57 };
58
59 static_assert(is_trivially_destructible<int>::value, "IsTriviallyDestructible");
60 static_assert(is_trivially_destructible<TriviallyDestructible>::value,
61 "IsTriviallyDestructible");
62 static_assert(!is_trivially_destructible<NonTriviallyDestructible>::value,
63 "IsTriviallyDestructible");
64
51 } // namespace 65 } // namespace
52 } // namespace base 66 } // namespace base
OLDNEW
« base/template_util.h ('K') | « base/template_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698