EASTL
EASTL copied to clipboard
[Question] Can eastl name space be renamed with standard std name?
Hello everyone,
Looking into your package and I am wondering if the above is doable? I could not find any reference to a similar question - I hope I did not miss. I have done a trivial trial by renaming all eastl appearances in your code by std. Platform is Windows VS2022. Also the build process breaks because of (understandable) name conflicts with Visual Studio std structures and class names. The first conflict came with std::integral_constant defined in type_traits.h in your code and xtr1common in VS2002. Do you guys know any method that let you do that?
The motivation is clear: have existing code that uses std switch to eastl seamlessly. (I know you would say, do the other way around and rename in your code std with eastl: although impossible since that code goes to multiple developers who already have std at home).
Thanks in advance, Serge
Thats defeats the whole purpose of name spaces. Name space exist with the sole purpose to avoid functions/variables/classes/whatever(s) name collisions.
Developers have std at home? Tell them to use eastd instead of std.
They cant change std to eastd? Why? In any case, tell them that using namespace std;
in a header/code file is actually a bad practice that, in this specific case, bited...bit them back.
It smells fishy...
I believe placing things inside namespace std
is considered undefined behavior in the standard, so unless you're writing a standard library for a particular compiler, you shouldn't do that.
Besides, if you really want to use eastl
in place of std
, you can use an alias:
namespace std = eastl;
Thanks Daniel for your feedback,
although eastl is built on top of std, i.e. it uses (on Windows) visual studio and windows kit headers. Those headers finally reach Microsoft's std headers. So having the alias above will cause many duplicates such as vector, map and many others.
Wouldn't renaming eastl
to std
cause the same name clashes, though? Perhaps I'm not understanding what you are trying to do.