stack.cpp 807 B

12345678910111213141516171819202122232425
  1. // Copyright Oliver Kowalke 2016.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include <cstdlib>
  6. #include <iostream>
  7. #include <boost/context/continuation.hpp>
  8. namespace ctx = boost::context;
  9. int main() {
  10. std::cout << "minimum stack size: " << ctx::stack_traits::minimum_size() << " byte\n";
  11. std::cout << "default stack size: " << ctx::stack_traits::default_size() << " byte\n";
  12. std::cout << "maximum stack size: ";
  13. if ( ctx::stack_traits::is_unbounded() ) {
  14. std::cout << "unlimited\n";
  15. } else {
  16. std::cout << ctx::stack_traits::maximum_size() << " byte\n";
  17. }
  18. std::cout << "main: done" << std::endl;
  19. return EXIT_SUCCESS;
  20. }