I am trying to create a class, that contains a std::vector
of void*
. I have been told, that void*
is the C++ equivalent to Object
in Java. Since this is the C++ port of a program written in Java it should work in theory.
Java:
ArrayList<Object> list;
C++:
vector<void*> list;
This won't compile, giving the error: "'reference': illegal use of type 'void'".
Is void*
really the C++ equivalent of Java's Object
? Am i using it the wrong way?