tower120 Posted February 7, 2021 Share Posted February 7, 2021 Bunch of classes inherited from APIInterface like Image, Texture, etc. have both constructor and `Ptr<T> create()` function. So, the question is - can I use C++ constructor for them? Are they stack or heap based? What happens when copy constructor occurs? Is it value copy, or just some internal pointer copy? Link to comment
tower120 Posted February 7, 2021 Author Share Posted February 7, 2021 Hmmm... I see now - C++ constructors not working with these classes. So the question is - why constructors are exposed? First of all this makes current API ambiguous, second - you have a possibility of human-error. P.S. If you need constructors to be public in order to construct object with your smart pointer... I'm sure this can be managed. Link to comment
silent Posted February 8, 2021 Share Posted February 8, 2021 tower120 Thanks for the feedback! Public constructors for sure can be managed, but it's not the priority task at this moment. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts