check an stack is empty c++

C++
std::stack <int> st;
if(st.empty())
  std::cout << "stack is empty";
Source

Also in C++: