diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-23 16:58:19 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-23 16:58:19 +0400 |
commit | d1e04d376dfa01037b5671abe53f8fb841be9173 (patch) | |
tree | 929a37f662d9c0f2c524b63fe6a16a01c9bec782 /source/blender | |
parent | 398fd3621ce62392f1bfcb40757643f9fac19931 (diff) |
RNA: fix collection iterator issue in c++ api with msvc.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 871cbad6152..42b78e3ff7e 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2662,6 +2662,11 @@ static const char *cpp_classes = "" "class Array {\n" "public:\n" " T data[Tsize];\n" +"\n" +" Array() {}\n" +" Array(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); }\n" +" const Array<T, Tsize>& operator=(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); return *this; }\n" +"\n" " operator T*() { return data; }\n" "};\n" "\n" @@ -2678,8 +2683,6 @@ static const char *cpp_classes = "" " operator bool(void)\n" " { return iter.valid != 0; }\n" " const CollectionIterator<T, Tbegin, Tnext, Tend>& operator++() { Tnext(&iter); t = T(iter.ptr); return *this; }\n" -" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator=(const CollectionIterator<T, Tbegin, Tnext, Tend>& copy)\n" -" { if(init) Tend(&iter); iter= copy.iter; if(iter.internal) iter.internal= MEM_dupallocN(iter.internal); t= copy.t; init= copy.init; return *this; }\n" "\n" " T& operator*(void) { return t; }\n" " T* operator->(void) { return &t; }\n" @@ -2690,6 +2693,8 @@ static const char *cpp_classes = "" " { if(init) Tend(&iter); Tbegin(&iter, (PointerRNA*)&ptr.ptr); t = T(iter.ptr); init = true; }\n" "\n" "private:\n" +" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator=(const CollectionIterator<T, Tbegin, Tnext, Tend>& copy) {}\n" +"" " CollectionPropertyIterator iter;\n" " T t;\n" " bool init;\n" @@ -2700,8 +2705,8 @@ static const char *cpp_classes = "" "public:\n" " Collection(const PointerRNA& p) : ptr(p) {}\n" "\n" -" CollectionIterator<T, Tbegin, Tnext, Tend> begin()\n" -" { CollectionIterator<T, Tbegin, Tnext, Tend> iter; iter.begin(ptr); return iter; }\n" +" void begin(CollectionIterator<T, Tbegin, Tnext, Tend>& iter)\n" +" { iter.begin(ptr); }\n" " CollectionIterator<T, Tbegin, Tnext, Tend> end()\n" " { return CollectionIterator<T, Tbegin, Tnext, Tend>(); } /* test */ \n" "\n" |