Browse Source

cmListFileCache: Add explicit constructors

In order to construct with an initializer list in pure C++11, add
the explicit constructors.
Brad King 5 years ago
parent
commit
0e59b45dfc
1 changed files with 8 additions and 0 deletions
  1. 8 0
      Source/cmListFileCache.h

+ 8 - 0
Source/cmListFileCache.h

@@ -73,6 +73,14 @@ public:
   std::string FilePath;
   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,
                                               std::string const& fileName)
   {