We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8adca5d commit 0ef77eaCopy full SHA for 0ef77ea
src/core/model/ptr.h
@@ -13,6 +13,7 @@
13
14
#include <iostream>
15
#include <stdint.h>
16
+#include <type_traits>
17
18
/**
19
* @file
@@ -427,6 +428,8 @@ struct EventMemberImplObjTraits<Ptr<T>>
427
428
namespace ns3
429
{
430
431
+class Object;
432
+
433
/*************************************************
434
* friend non-member function implementations
435
************************************************/
@@ -435,6 +438,8 @@ template <typename T, typename... Ts>
438
Ptr<T>
436
439
Create(Ts&&... args)
437
440
441
+ static_assert(!std::is_base_of_v<Object, T>,
442
+ "Use CreateObject() instead of Create() for Object subclasses");
443
return Ptr<T>(new T(std::forward<Ts>(args)...), false);
444
}
445
0 commit comments