Uhh, I'm just spitballing here but here's what it seems to be from my perspective:
When you make the copy constructor private, it can't be accessed, so copies of that object cannot be made. That's what will cause a compile-time error, because something that doesn't have access to the private members of the Mesh class is trying to access it. When you make it public, I'm quite sure it gives you a linking error, because the function call is now appropriate, but I'm assuming you didn't actually define the copy constructor?
The designer of this tutorial obviously wanted to point out that copying will screw thigs up, and it does. I tried commenting out copy constructor so it uses default, and the application shits itself for some reason. Is there a way I can have a dynamic array like std::vector, but avoid copying when adding new instances of that mesh class?
And please, don't ask me what the hell I'm asking. You will hopefully magically understand what I meant
cypher1554R wrote:The designer of this tutorial obviously wanted to point out that copying will screw thigs up, and it does. I tried commenting out copy constructor so it uses default, and the application shits itself for some reason. Is there a way I can have a dynamic array like std::vector, but avoid copying when adding new instances of that mesh class?
And please, don't ask me what the hell I'm asking. You will hopefully magically understand what I meant
Use a pointer to a Mesh object instead of creating a new local instance of the Mesh class? (Just guessing here, don't really have enough info to fully debug your situation)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
My C++ is getting a bit rusty, but I think it's because you're storing <Mesh>'es. Then it has to run the copy constructor to store it in the vector, but if you used <Mesh*>, it won't instantiate it through the copy constructor. Kinda like you can't declare an array of SomeObject someObjectArray[n]; where the default constructor with no parameters is private or not made by the compiler because you've made one with parameters.
That is, IIRC