[vte] ring: Add some static assertions



commit 838150fbdc2ffff1b18e739d1deb19d9bef00afc
Author: Christian Persch <chpe src gnome org>
Date:   Mon Apr 23 20:51:18 2018 +0200

    ring: Add some static assertions
    
    Just to make sure nothing breaks during refactoring.

 src/vterowdata.cc |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/vterowdata.cc b/src/vterowdata.cc
index 185aba7..1f00ae5 100644
--- a/src/vterowdata.cc
+++ b/src/vterowdata.cc
@@ -25,6 +25,16 @@
 
 #include <string.h>
 
+#include <type_traits>
+
+/* This will be true now that VteCell is POD, but make sure it'll be true
+ * once that changes.
+ */
+static_assert(std::is_trivially_copy_constructible<VteCell>::value, "VteCell is not trivially copyable");
+static_assert(std::is_trivially_move_constructible<VteCell>::value, "VteCell is not trivially copyable");
+static_assert(std::is_trivially_copyable<VteCell>::value, "VteCell is not trivially copyable");
+static_assert(std::is_trivially_copy_assignable<VteCell>::value, "VteCell is not trivially movable");
+static_assert(std::is_trivially_move_assignable<VteCell>::value, "VteCell is not trivially movable");
 
 /*
  * VteCells: A row's cell array


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]