My snippet of code:
void
RMWavefrontFileImporter::loadVertexIntoVector(
const std::vector<std:string> lineElements,
std::vector<const RM3DVertex>* vertices)
{
assert(vertices);
std::unique_ptr<const RM3DVertex> verticeRef = verticeWithElements(lineElements);
const RM3DVertex* vertex = vertexRef.get();
assert(vertex);
vertices->push_back(*vertex);
}
The error message I'm getting:
Cannot initialize a parameter of type 'void *' with an lvalue of type 'const RM3DVertice *'
I'm failing to see the problem. Is there anything obvious I'm missing?
The value type
Tof astd::vector<T>needs to be CopyInsertible or MoveInsertible. To be either, it is necessary to call the moral equivalent ofWith
Tbeing aconsttype this doesn't work, e.g., because there is no conversion fromT*tovoid*ifTis of the formX const. You want to remove theconstfromstd::vector<const RM3DVertice>.