t10241.nim 381 B

1234567891011121314151617181920
  1. discard """
  2. targets: "cpp"
  3. action: "compile"
  4. """
  5. type
  6. String* {.importcpp: "std::string", header: "string".} = object
  7. proc initString*(): String
  8. {.importcpp: "std::string()", header: "string".}
  9. proc append*(this: var String, str: String): var String
  10. {.importcpp: "append", header: "string", discardable.}
  11. var
  12. s1 = initString()
  13. s2 = initString()
  14. s1.append s2