summary refs log tree commit diff stats
path: root/tests/cpp/t10241.nim
blob: 21d6a0f4e491a94236988ba9c5cbd63845938437 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  targets: "cpp"
  action: "compile"
"""

type
  String* {.importcpp: "std::string", header: "string".} = object

proc initString*(): String
    {.importcpp: "std::string()", header: "string".}

proc append*(this: var String, str: String): var String
    {.importcpp: "append", header: "string", discardable.}

var
  s1 = initString()
  s2 = initString()

s1.append s2