WRT below code, it compiles fine & also executes without any exception. But no content gets written to the javascript file. It's 0 bytes.

```
std::map<std::string, std::shared_ptr<std::ofstream>> m_jsTabFilesMap;
m_jsTabFilesMap.insert({ fileKey, std::make_shared<std::ofstream>(jsFilename) });
auto jsFile = m_jsTabFilesMap[tabName];
(*jsFile).open(tabName + ".js");
*jsFile << contentofJSFile;  // write to JS file

```

**Not sure what did i miss, how do i make it write to file.**

**[UPDATES TO QUESTION]**
Using normal pointer method is also causing same result.

```
std::map<std::string,std::ofstream*> m_jsTabFilesMap;
m_jsTabFilesMap.insert({ filekey, new std::ofstream(jsFilename)});

```

Also tried removing the explicit Open() call & same result, nothing gets written to file.