Bugzilla – Bug 2943
Simplify the implementation of ns3::Create
Last modified: 2018-07-06 11:26:31 EDT
Created attachment 3125 [details] Patch to simplify ns3::Create This patch simplifies the implementation of ns3::Create by using variadic templates and perfect forwarding. There are three main advantages: (1) An arbitrary number of parameters can be passed to the constructor of T without needing to manually specify the overloads (2) Copying the parameters can be potentially avoided (3) The documentation of Create is simplified as there is only one entry present for it This implementation is very similar to that of std::make_unique [1]. [1] https://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique#Possible_Implementation