I am getting following error for class which wrapper for va_list.
error: "<invalid operator>" declared as function returning an array Here is the class definition.
1 #include <stdarg.h>
2 #ifndef __va_size
3 #define __va_size(type) (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
4 #endif // __va_size
5
6 class VAList {
7 protected:
8 va_list ap;
9 public:
10 template<class _Type> VAList(_Type const& last) {
11 va_copy(ap ,*((va_list*)((char *)&(last) + __va_size(last))));
12 }
13 ~VAList() {
14 va_end(ap);
15 }
16 operator va_list() const {
17 return ap;
18 }
19 };
VAList.hh:16: error: <invalid operator> declared as function returning an array
gcc version 4.4.6.
Please help to fix this error.