Преглед изворни кода

cmListFileCache: Add explicit constructors

In order to construct with an initializer list in pure C++11, add
the explicit constructors.
Brad King пре 5 година
родитељ
комит
0e59b45dfc
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      Source/cmListFileCache.h

+ 8 - 0
Source/cmListFileCache.h

@@ -73,6 +73,14 @@ public:
   std::string FilePath;
   std::string FilePath;
   long Line = 0;
   long Line = 0;
 
 
+  cmListFileContext() = default;
+  cmListFileContext(std::string name, std::string filePath, long line)
+    : Name(std::move(name))
+    , FilePath(std::move(filePath))
+    , Line(line)
+  {
+  }
+
   static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
   static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
                                               std::string const& fileName)
                                               std::string const& fileName)
   {
   {