Browse Source

express: fix PointerToArray coercibility regression, fix clear()

This was caused by the assignment operators not being visible to interrogate.
rdb 7 years ago
parent
commit
2e7bca90b0
1 changed files with 14 additions and 8 deletions
  1. 14 8
      panda/src/express/pointerToArray.h

+ 14 - 8
panda/src/express/pointerToArray.h

@@ -98,6 +98,8 @@ PUBLISHED:
 
 
   EXTENSION(PointerToArray(PyObject *self, PyObject *source));
   EXTENSION(PointerToArray(PyObject *self, PyObject *source));
 
 
+  INLINE void clear();
+
   INLINE size_type size() const;
   INLINE size_type size() const;
   INLINE void push_back(const Element &x);
   INLINE void push_back(const Element &x);
   INLINE void pop_back();
   INLINE void pop_back();
@@ -157,6 +159,8 @@ public:
   INLINE size_type max_size() const;
   INLINE size_type max_size() const;
   INLINE bool empty() const;
   INLINE bool empty() const;
 
 
+  INLINE void clear();
+
   // Functions specific to vectors.
   // Functions specific to vectors.
   INLINE void reserve(size_type n);
   INLINE void reserve(size_type n);
   INLINE void resize(size_type n);
   INLINE void resize(size_type n);
@@ -216,6 +220,9 @@ public:
 
 
   INLINE size_t count(const Element &) const;
   INLINE size_t count(const Element &) const;
 
 
+#endif  // CPPPARSER
+
+public:
   // Reassignment is by pointer, not memberwise as with a vector.
   // Reassignment is by pointer, not memberwise as with a vector.
   INLINE PointerToArray<Element> &
   INLINE PointerToArray<Element> &
   operator = (ReferenceCountedVector<Element> *ptr);
   operator = (ReferenceCountedVector<Element> *ptr);
@@ -224,18 +231,14 @@ public:
   INLINE PointerToArray<Element> &
   INLINE PointerToArray<Element> &
   operator = (PointerToArray<Element> &&from) noexcept;
   operator = (PointerToArray<Element> &&from) noexcept;
 
 
-  INLINE void clear();
-
 private:
 private:
   TypeHandle _type_handle;
   TypeHandle _type_handle;
 
 
-private:
   // This static empty array is kept around just so we can return something
   // This static empty array is kept around just so we can return something
   // meaningful when begin() or end() is called and we have a NULL pointer.
   // meaningful when begin() or end() is called and we have a NULL pointer.
   // It might not be shared properly between different .so's, since it's a
   // It might not be shared properly between different .so's, since it's a
   // static member of a template class, but we don't really care.
   // static member of a template class, but we don't really care.
   static pvector<Element> _empty_array;
   static pvector<Element> _empty_array;
-#endif  // CPPPARSER
 
 
   friend class ConstPointerToArray<Element>;
   friend class ConstPointerToArray<Element>;
 };
 };
@@ -256,6 +259,8 @@ PUBLISHED:
   INLINE ConstPointerToArray(const PointerToArray<Element> &copy);
   INLINE ConstPointerToArray(const PointerToArray<Element> &copy);
   INLINE ConstPointerToArray(const ConstPointerToArray<Element> &copy);
   INLINE ConstPointerToArray(const ConstPointerToArray<Element> &copy);
 
 
+  INLINE void clear();
+
   typedef TYPENAME pvector<Element>::size_type size_type;
   typedef TYPENAME pvector<Element>::size_type size_type;
   INLINE size_type size() const;
   INLINE size_type size() const;
   INLINE const Element &get_element(size_type n) const;
   INLINE const Element &get_element(size_type n) const;
@@ -311,6 +316,8 @@ PUBLISHED:
   INLINE size_type max_size() const;
   INLINE size_type max_size() const;
   INLINE bool empty() const;
   INLINE bool empty() const;
 
 
+  INLINE void clear();
+
   // Functions specific to vectors.
   // Functions specific to vectors.
   INLINE size_type capacity() const;
   INLINE size_type capacity() const;
   INLINE reference front() const;
   INLINE reference front() const;
@@ -342,6 +349,9 @@ PUBLISHED:
 
 
   INLINE size_t count(const Element &) const;
   INLINE size_t count(const Element &) const;
 
 
+#endif  // CPPPARSER
+
+public:
   // Reassignment is by pointer, not memberwise as with a vector.
   // Reassignment is by pointer, not memberwise as with a vector.
   INLINE ConstPointerToArray<Element> &
   INLINE ConstPointerToArray<Element> &
   operator = (ReferenceCountedVector<Element> *ptr);
   operator = (ReferenceCountedVector<Element> *ptr);
@@ -354,18 +364,14 @@ PUBLISHED:
   INLINE ConstPointerToArray<Element> &
   INLINE ConstPointerToArray<Element> &
   operator = (ConstPointerToArray<Element> &&from) noexcept;
   operator = (ConstPointerToArray<Element> &&from) noexcept;
 
 
-  INLINE void clear();
-
 private:
 private:
   TypeHandle _type_handle;
   TypeHandle _type_handle;
 
 
-private:
   // This static empty array is kept around just so we can return something
   // This static empty array is kept around just so we can return something
   // meangful when begin() or end() is called and we have a NULL pointer.  It
   // meangful when begin() or end() is called and we have a NULL pointer.  It
   // might not be shared properly between different .so's, since it's a static
   // might not be shared properly between different .so's, since it's a static
   // member of a template class, but we don't really care.
   // member of a template class, but we don't really care.
   static pvector<Element> _empty_array;
   static pvector<Element> _empty_array;
-#endif  // CPPPARSER
 
 
   friend class PointerToArray<Element>;
   friend class PointerToArray<Element>;
 };
 };