aboutsummaryrefslogtreecommitdiff
path: root/test/source/TestCppCXTypeTraits.cpp
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-04-08 16:43:58 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-04-08 16:43:58 +0200
commite59cf7b09e7388d369e8d2bf73501cde79c28708 (patch)
tree6099307032bb86f4a969721f9ac447d3d1be67d4 /test/source/TestCppCXTypeTraits.cpp
Squashed 'EASTL/' content from commit fad5471
git-subtree-dir: EASTL git-subtree-split: fad54717f8e4ebb13b20095da7efd07a53af0f10
Diffstat (limited to 'test/source/TestCppCXTypeTraits.cpp')
-rw-r--r--test/source/TestCppCXTypeTraits.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/source/TestCppCXTypeTraits.cpp b/test/source/TestCppCXTypeTraits.cpp
new file mode 100644
index 0000000..ab03aa7
--- /dev/null
+++ b/test/source/TestCppCXTypeTraits.cpp
@@ -0,0 +1,35 @@
+/////////////////////////////////////////////////////////////////////////////
+// Copyright (c) Electronic Arts Inc. All rights reserved.
+/////////////////////////////////////////////////////////////////////////////
+
+
+#include "EASTLTest.h"
+#include <EASTL/type_traits.h>
+
+using namespace eastl;
+
+#if defined(__cplusplus_winrt)
+ ref class Foo
+ {
+
+ };
+#endif
+
+int TestCppCXTypeTraits()
+{
+ int nErrorCount = 0;
+
+ // We can only build this code if C++/CX is enabled
+#if defined(__cplusplus_winrt)
+ {
+ Foo^ foo = ref new Foo();
+ static_assert(eastl::is_pod<Foo^>::value == false, "Ref types are not POD");
+ static_assert(eastl::is_trivially_destructible<Foo^>::value == false, "Ref types cannot be trivially destructible");
+ static_assert(eastl::is_trivially_constructible<Foo^>::value == false, "Ref types cannot be trivially constructible");
+ static_assert(eastl::is_trivially_copy_constructible<Foo^>::value == false, "Ref types cannot be trivially copyable");
+ static_assert(eastl::is_trivially_copy_assignable<Foo^>::value == false, "Ref types cannot be trivially copyable");
+ }
+#endif
+
+ return nErrorCount;
+}