+/** C++ wrapper for xtb_new
+ *
+ * This ensures that we do not xbt_new things that need a constructor.
+ */
+template<typename T> inline
+T* xbt_new_(size_t count)
+{
+ static_assert(std::is_trivial<T>(),
+ "Cannot xbt_new this type");
+ return (T*) xbt_malloc(sizeof(T) * count);
+}
+
+template<typename T> inline
+T* xbt_new0_(size_t count)
+{
+ static_assert(std::is_trivial<T>(),
+ "Cannot xbt_new0 this type");
+ return (T*) xbt_malloc0(sizeof(T) * count);
+}
+
+#define xbt_new(type, count) ::xbt_new_<type>(count)
+#define xbt_new0(type, count) ::xbt_new0_<type>(count)
+
+#endif
+
+/** @} */