print_container.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2004-2013. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/container for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_PRINTCONTAINER_HPP
  11. #define BOOST_PRINTCONTAINER_HPP
  12. #include <boost/container/detail/config_begin.hpp>
  13. #include <iostream>
  14. namespace boost{
  15. namespace container {
  16. namespace test{
  17. //Function to dump data
  18. template<class MyBoostCont
  19. ,class MyStdCont>
  20. void PrintContainers(MyBoostCont *boostcont, MyStdCont *stdcont)
  21. {
  22. typename MyBoostCont::iterator itboost = boostcont->begin(), itboostend = boostcont->end();
  23. typename MyStdCont::iterator itstd = stdcont->begin(), itstdend = stdcont->end();
  24. std::cout << "MyBoostCont" << std::endl;
  25. for(; itboost != itboostend; ++itboost){
  26. std::cout << *itboost << std::endl;
  27. }
  28. std::cout << "MyStdCont" << std::endl;
  29. for(; itstd != itstdend; ++itstd){
  30. std::cout << *itstd << std::endl;
  31. }
  32. }
  33. } //namespace test{
  34. } //namespace container {
  35. } //namespace boost{
  36. #include <boost/container/detail/config_end.hpp>
  37. #endif //#ifndef BOOST_PRINTCONTAINER_HPP