Skip to content

Commit

Permalink
added constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mantielero committed Nov 26, 2022
1 parent 10b5185 commit b297836
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cppstl/std_smartptrs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ when not defined(cpp):
type
CppSharedPtr*[T]{.importcpp: "std::shared_ptr", bycopy.} = object

proc newCppSharedPtr[T](p: ptr T): CppSharedPtr[T] {.constructor,
importcpp: "std::shared_ptr<'*0>(#)".}

func makeShared*(T: typedesc): CppSharedPtr[T] {.importcpp: "std::make_shared<'*0>()".}

func makeShared*[T](p: CppSharedPtr[T]): CppSharedPtr[T] {.importcpp: "std::make_shared<'*0>(#)".}
Expand Down

0 comments on commit b297836

Please sign in to comment.