ddiakopoulos / tinyply

:earth_africa: C++11 ply 3d mesh format importer & exporter
598 stars 118 forks source link

Including the header brings in std and tinyply namespace #43

Closed TristramShandy closed 4 years ago

TristramShandy commented 4 years ago

When including the library with #define TINYPLY_IMPLEMENTATION, the std and tinyply namespaces are automatically included via using declarations. This introduces in a lot of very common names (like Type and Buffer from tinyply:: or vector from std::) into the declarative region that is using tinyply and can lead to unexpected and hard to debug errors.

As a fix, I suggest to write the implementation like this

namespace tinyply
{
  using namespace std;
  // implementation here
}
ddiakopoulos commented 4 years ago

Thanks @TristramShandy - I've fixed this on the master branch.