debug.hpp 731 B

12345678910111213141516171819202122
  1. // Copyright 2019 Hans Dembinski
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt
  5. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_HISTOGRAM_DETAIL_DEBUG_HPP
  7. #define BOOST_HISTOGRAM_DETAIL_DEBUG_HPP
  8. #include <boost/config/pragma_message.hpp>
  9. BOOST_PRAGMA_MESSAGE("debug.hpp included")
  10. #include <boost/histogram/detail/type_name.hpp>
  11. #include <iostream>
  12. #define DEBUG(x) \
  13. std::cout << __FILE__ << ":" << __LINE__ << " [" \
  14. << boost::histogram::detail::type_name<decltype(x)>() << "] " #x "=" << x \
  15. << std::endl;
  16. #endif