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

Side by Side Diff: base/template_util_unittest.cc

Issue 2792183003: Remove base::is_trivially_destructible and use the standard library. (Closed)
Patch Set: triviallydestruct: rm-tests Created 3 years, 8 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
« no previous file with comments | « base/template_util.h ('k') | base/trace_event/heap_profiler_allocation_register.h » ('j') | 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 <string> 7 #include <string>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 static_assert(!internal::SupportsOstreamOperator<SimpleStruct>::value, 62 static_assert(!internal::SupportsOstreamOperator<SimpleStruct>::value,
63 "simple struct should not be printable by value"); 63 "simple struct should not be printable by value");
64 static_assert(!internal::SupportsOstreamOperator<const SimpleStruct&>::value, 64 static_assert(!internal::SupportsOstreamOperator<const SimpleStruct&>::value,
65 "simple struct should not be printable by const ref"); 65 "simple struct should not be printable by const ref");
66 static_assert(internal::SupportsOstreamOperator<StructWithOperator>::value, 66 static_assert(internal::SupportsOstreamOperator<StructWithOperator>::value,
67 "struct with operator<< should be printable by value"); 67 "struct with operator<< should be printable by value");
68 static_assert( 68 static_assert(
69 internal::SupportsOstreamOperator<const StructWithOperator&>::value, 69 internal::SupportsOstreamOperator<const StructWithOperator&>::value,
70 "struct with operator<< should be printable by const ref"); 70 "struct with operator<< should be printable by const ref");
71 71
72 struct TriviallyDestructible {
73 int field;
74 };
75
76 class NonTriviallyDestructible {
77 ~NonTriviallyDestructible() {}
78 };
79
80 static_assert(is_trivially_destructible<int>::value, "IsTriviallyDestructible");
81 static_assert(is_trivially_destructible<TriviallyDestructible>::value,
82 "IsTriviallyDestructible");
83 static_assert(!is_trivially_destructible<NonTriviallyDestructible>::value,
84 "IsTriviallyDestructible");
85
86 } // namespace 72 } // namespace
87 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « base/template_util.h ('k') | base/trace_event/heap_profiler_allocation_register.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698