표준라이브러리에 있는 모든 것은 std namespace 안에 있습니다.
C 에서 호환을 위한 라이브러리와 C++ 에서 추가된 표준라이브러리 들은 모두
namespace std 에 들어있습니다.
C++ 에서 stdlib 을 쓰고자 한다면 두 가지 방법이 있을 수 있겠지요.
1. #include <stdlib.h>
2. #include <cstdlib>
이 때 1번에 들어있는 라이브러리는 std 안에 들어있지 않고
2번에 들어있는 라이브러리는 std 안에 들어있습니다.
不加 std 命名空間時對,
priority_queue<Event> FutureEventList;
queue<Event> Customers;
的報錯:
Event.cpp:37: error: expected constructor, destructor, or type conversion before ‘<’ token
Event.cpp:38: error: expected constructor, destructor, or type conversion before ‘<’ token