Skip to content

Commit

Permalink
C++: no duplicate <memory> #includes, fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Aug 12, 2020
1 parent 07d71cc commit a1c9fba
Showing 1 changed file with 1 addition and 8 deletions.
Expand Up @@ -54,7 +54,6 @@ class CppCompiler(
outSrcHeader.puts(s"// $headerComment")
outSrcHeader.puts

importListSrc.addSystem("memory")
importListSrc.addLocal(outFileNameHeader(topClassName))

if (config.cppConfig.usePragmaOnce) {
Expand Down Expand Up @@ -109,13 +108,8 @@ class CppCompiler(
}
}

override def importFile(file: String): Unit = {
importListHdr.addLocal(outFileNameHeader(file))
}

override def opaqueClassDeclaration(classSpec: ClassSpec): Unit = {
classForwardDeclaration(classSpec.name)
importListSrc.addLocal(outFileNameHeader(classSpec.name.head))
importListHdr.addLocal(outFileNameHeader(classSpec.name.head))
}

override def classHeader(name: List[String]): Unit = {
Expand Down Expand Up @@ -802,7 +796,6 @@ class CppCompiler(
case SharedPointers =>
s"std::make_shared<${types2class(t.name)}>($addParams$io$addArgs)"
case UniqueAndRawPointers =>
importListSrc.addSystem("memory")
// C++14
//s"std::make_unique<${types2class(t.name)}>($addParams$io$addArgs)"
s"std::unique_ptr<${types2class(t.name)}>(new ${types2class(t.name)}($addParams$io$addArgs))"
Expand Down

0 comments on commit a1c9fba

Please sign in to comment.