Amol said:
I would like to ask two simple questions.
If you extend the std namespace how will you port your code to other
platform?
Not sure what problem you are thinking of. Extending 'std' namespace
and portability are orthogonal. Your program will contain the 'std'
namespace extension, and since the contents of 'std' namespace are
essentially the same (the common denominator, anyway) on all platforms,
you just bring your extension to the target platform, and it should
compile without a problem.
If you make changes to the std namespace how can others will port
their code to your machine?
Again, if others have written portable programs, how would an extension
of 'std' namespace in _only one_ of your programs affect that?
Remember it's a **standard** and you are not a member of the standards
committee if you want to extend the std namespace try to become member
of the standards committee. Hope you will become that one day.
WTF are you talking about?
If I need to implement a specialisation of 'std::less' template for
my particular type (for whatever reason), I am _explicitly allowed_ to
do so by the Standard Committee. But the extend of my extension is
limited to my own code. I can share it with you, and then it becomes
part of your own code, and none of that affects anybody else who does
not add those extensions to their programs.
V