1

E.g. if vector/deque/list/map all represents "container", then I would suppose there should be a namespace of "std::containers". C++11 also introduced thread/atomic, it's just std::thread and std::atomic, no extra namespace.

#include<chrono>
#include<iostream>
#include<unistd.h>
using namespace std;
using namespace std::chrono;
int main()
{
    auto t1=system_clock::now();
    sleep(2);

    auto t2=system_clock::now();
    auto duration=t2-t1;
    cout<<duration.count()<<endl;
    return 0;
}

I wish to know why c++11 language standard would introduce such an extra namespace for time related operations?

Troskyvs
  • 7,537
  • 7
  • 47
  • 115

0 Answers0