I am trying to set up a multi-typename method in an objects constructor to call from within a derived class, but I cannot figure out why I am getting the following error:
no instance of constructor "VBO::VBO" matches the argument list
argument types are:
(VkGraphicsPipeline *, std::vector<Vertex, std::allocator<Vertex>>)
The VBO object is defined as follows:
struct VBO {
VkBuffer buffer;
VkDeviceMemory memory;
VBO(VkGraphicsUnit* pVkGPU, std::vector<std::variant<Vertex, uint32_t>> content) {
...; }
};
The VkGraphicsPipeline object is defined as the child of a VkGraphicsUnit object:
struct VkGraphicsPipeline : VkGraphicsUnit {
VkGraphicsPipeline(VulkanAPI VkApplication, std::vector<Vertex> vertices) : VkGraphicsUnit(VkApplication) {
VBO(this, vertices);
...; }
};
I have tried the following things, all of which have failed to fix the error:
Adding "public" before "VkGraphicsUnit"
struct VkGraphicsPipeline : public VkGraphicsUnit
Adding VBO as a subclass of VkGraphicsPipeline
Removing the inheritance of VkGraphicsUnit and calling it explicitly
struct VkGraphicsPipeline {
VkGraphicsPipeline(VkGraphicsUnit* pVkGPU, std::vector<Vertex> vertices) {
VBO(pVkGPU, vertices);
...; }
};
And even trying out the other available variant in the VBO constructor
VkGraphicsPipeline(VkGraphicsUnit* pVkGPU, std::vector<uint32_t> indices) {
VBO(pVkGPU, indices); }
In the last two cases, the error I was getting was,
no instance of constructor "VBO::VBO" matches the argument list
argument types are:
(VkGraphicsUnit *, std::vector<Vertex, std::allocator<Vertex>>)
and
no instance of constructor "VBO::VBO" matches the argument list
argument types are:
(VkGraphicsUnit *, std::vector<uint32_t, std::allocator<uint32_t>>)
I am completely lost for a solution. Please help me find out what I am missing and how/if I can get around this error without making my code any more complicated than it already is.
VBO(this, vertices);
should be in the member initializer list? In the body of the constructor it does nothing useful