GAPI: fix C++17 compilation errors in GNetPackage (fixes #17385)
authorAnton Potapov <anton.potapov@intel.com>
Tue, 1 Dec 2020 06:34:53 +0000 (09:34 +0300)
committerAnton Potapov <anton.potapov@intel.com>
Tue, 1 Dec 2020 06:34:53 +0000 (09:34 +0300)
- explicitly declared default constructor
- made initilizer_list  constructor to accept the list by copy
   -- as it is  more canonical (and as copying the initializer_list does
not force copy of the list items)
   -- current version anyway does not do what it is intended to

modules/gapi/include/opencv2/gapi/infer.hpp
modules/gapi/src/api/ginfer.cpp

index b850775..f20f638 100644 (file)
@@ -418,8 +418,8 @@ struct GAPI_EXPORTS GNetParam {
  * @sa cv::gapi::networks
  */
 struct GAPI_EXPORTS_W_SIMPLE GNetPackage {
-    GAPI_WRAP GNetPackage() : GNetPackage({}) {}
-    explicit GNetPackage(std::initializer_list<GNetParam> &&ii);
+    GAPI_WRAP GNetPackage() = default;
+    explicit GNetPackage(std::initializer_list<GNetParam> ii);
     std::vector<GBackend> backends() const;
     std::vector<GNetParam> networks;
 };
index 156f893..f4bd1c3 100644 (file)
@@ -16,8 +16,8 @@
 
 #include <opencv2/gapi/infer.hpp>
 
-cv::gapi::GNetPackage::GNetPackage(std::initializer_list<GNetParam> &&ii)
-    : networks(std::move(ii)) {
+cv::gapi::GNetPackage::GNetPackage(std::initializer_list<GNetParam> ii)
+    : networks(ii) {
 }
 
 std::vector<cv::gapi::GBackend> cv::gapi::GNetPackage::backends() const {