Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
serjepatoff authored Sep 16, 2024
1 parent 51e04b0 commit 66174bc
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ requires "cppstl"

## Limitations

``cppstl`` currently wraps :
#### ``cppstl`` currently wraps :

* ``std::string``
* ``std::basic_string``
Expand All @@ -39,6 +39,26 @@ requires "cppstl"
* ``std::unique_ptr``
* ``std::shared_ptr``

#### Avoid using wrapped STL objects in top-level Nim scope.
Most of the times it works on Nim 1.x but leads to both compile-time and runtime errors on 2.x.
So instantiate them in subroutines only to ensure portability between 1.x and 2.x.

I.e this usecase is not recommended:
```
when isMainModule:
var vec = initCppVector[int]()
vec.pushBack(20)
```
Use this one instead:
```
when isMainModule:
proc foo =
var vec = initCppVector[int]()
vec.pushBack(20)
foo()
```


## Contributions

All contributions are welcome!
Expand Down

0 comments on commit 66174bc

Please sign in to comment.