-
Notifications
You must be signed in to change notification settings - Fork 2
misc feedback #1
Comments
=> |
|
=> you'll get syntax highlighting for free when reading source code, syntax is more concise (no need for newline etc) and code block still has some limitations (thanks for addressing some of them in nim-lang/Nim#14306, there's still (this one is important IMO) |
=>
and being lazy is ok here with just the raw uril, unless you want to use the rst (ugly...) syntax like: `front <https://en.cppreference.com/w/cpp/container/vector/front>`_ |
I had tried that, but it fails on running
Also, I like the My preferred way would have been: when not defined(cpp):
{.error: "This library needs to be compiled with the cpp backend.".} But it fails with a similar error when running
|
runnableExamples does not work when the proc has no body (like in the case of just importcpp-only wrappers. Example: proc len*(v: Vector): SizeType {.importcpp: "#.size()".}
## Return the number of elements in the Vector.
##
## This has an alias proc `size`.
##
## .. code-block::
## :test:
## var
## v = newVector[int]()
## doAssert v.size() == 0
##
## v.add(100)
## v.add(200)
## doAssert v.len() == 2
##
## https://en.cppreference.com/w/cpp/container/vector/size For the cases where the proc is not just importcpp based wrapper, I have used runnableExamples. |
just add I have yet to find a single use case for |
In order to use runnableExamples for importcpp wrappers without proc bodies, simply end the proc declaration with a `=`. Thanks @timotheecour for that tip ( #1 (comment) ) Ref: #1 (comment)
ok i see the problem; this works:
but IMO |
Thanks for that. |
Moved this to a separate issue. |
@timotheecour After adding the trailing
Do you know a way to avoid that warning? |
|
ok i fixed nim-lang/Nim#14314 and it's in devel :) |
…s`, `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
This is now |
I will now be archiving this repo as I have resolved that issue. This repo content is now merged into nim-cppstl. |
Closing this issue as all check-box items are complete. |
SizeType* = uint
is incorrectuse
SizeType* = csize_t
instead (only incorrect in case std::vector is created with a custom size_type, but your API doesn't expose that anyways, and it'd be a niche case)swap is missing; it's pretty useful for performance (edit by @kaushalmodi: moved to Add wrapper for
swap
#2)things like
first
can SIGSEGV in case container is empty; probably needswhen compileOption("boundChecks"): ...
as done in some procs in https://github.com/BigEpsilon/nim-cppstl/blob/master/src/cppstl/vector.nim ; but maybe let's hold off until Collaborate on the std::vector wrapper? Clonkk/nim-cppstl#3 is resolvedThe text was updated successfully, but these errors were encountered: