I have a C++ type like:
template <typename T>
class Vector {
struct Iterator {
};
};
And in C++ I can use Iterator
as Vector<int>::Iterator
.
How do I wrap this to use it from Nim? c2nim emits
type Vector[T] {.importcpp...} = object
type Iterator[T] {.importcpp...}
which doesn't compile because nim doesn't have nested types, and would produce Vector<T>::Iterator<T>
rather than Vector<T>::Iterator
.
I can use non-nested types in Nim:
type VectorIterator[T] {.importcpp: "Vector::Iterator".}
var v : VectorIterator[cint]
And this naturally produces Vector::Iterator<int>
, which is wrong (it should be Vector<int>::Iterator
).
Is there a way to change the import specification to produce the correct output?
Foo::Bar<T>
. I don't know how to make it work withFoo<T>::Bar
. – Bosket