MicBosi / VisualizationLibrary

Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.
http://VisualizationLibrary.org
Other
339 stars 94 forks source link

Fix compilation errors about template with gcc and mingw. Fix a lot o… #193

Closed FabienMathieu closed 3 years ago

FabienMathieu commented 3 years ago

Hi,

Trying to compile current master, I got errors template with gcc and Mingw (there are the same, I know, I just want to be precise :) ). error

It seams the standard doesn't like the empty specialization whereas we are in a template class because we use the same templated type. I removed them in order to make VL compile.

Aside these errors, I noticed a lot of warnings. I mainly fixed two types which are the most repeated:

The first one was easy to fix, because it only needs to replace a lot of int in the for loop with the _sizet when you iterate on a collection.

The second one was a bit more complex, at least to understand as this. In the C++11 standard, which is the standard used by default on my compilers (and I forced it to be sure), if a copy constructor is explicitly defined, a assignment operator has to be explicitly defined as well, and the opposite is also true. To fix this warning, I simply add either copy constructor, either assignment operator. The way I fixed it need to use C++11, which is, in my humble opinion, the current standard we should use now. There is an older way to fix it, filling empty the function.

Hoping that can help, let me know if you want more information.

Cordially

Fabien MATHIEU

MicBosi commented 3 years ago

Thanks @FabienMathieu!

The way I fixed it need to use C++11, which is, in my humble opinion, the current standard we should use now. There is an older way to fix it, filling empty the function.

Yep, sounds good! 👍