OLD | NEW |
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 Loading... |
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 |
OLD | NEW |