acidrainstudios / TrueReality

True Reality (TR) is an open source LGPL Game and Simulation Engine written entirely in Standard C++ and OpenGL. It runs on all Windows platforms and GNU/Linux. OpenSceneGraph is used as its graphics engine, along with many other open source projects for support of various features.
GNU Lesser General Public License v3.0
12 stars 7 forks source link

trUtil::RefStr string constructor needs to be placed back #114

Closed DieSlower closed 5 years ago

DieSlower commented 5 years ago

Originally the RefStr had two constructors:
trUtil::RefStr& operator=(const std::string& value); trUtil::RefStr& operator=(const RefStr& value);

trUtil::RefStr& operator=(const std::string& value); was removed because of ambiguous errors during compilation. This happened when a RefStr was assigned to a RefPtr because RefPtr has both implicit conversion operators and both constructors to take string and RefStr.

The constructor that needs to be removed is trUtil::RefStr& operator=(const RefStr& value); because an assigned RefStr can always convert itself to a string, while an std::string can not convert itself to a RefStr