current_function_support.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2015.
  3. * Distributed under the Boost Software License, Version 1.0.
  4. * (See accompanying file LICENSE_1_0.txt or copy at
  5. * http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. /*!
  8. * \file current_function_support.cpp
  9. * \author Andrey Semashev
  10. * \date 26.09.2010
  11. *
  12. * \brief This test checks that the BOOST_CURRENT_FUNCTION macro has semantics
  13. * compatible with Boost.Log on the current platform.
  14. *
  15. * The point of this test is to determine whether the macro unfolds into a string literal
  16. * rather than a pointer to a string. This is critical because BOOST_LOG_WFUNCTION
  17. * relies on this fact - it determines the length of the literal by applying sizeof to it.
  18. */
  19. #define BOOST_TEST_MODULE current_function_support
  20. #include <boost/current_function.hpp>
  21. #include <boost/static_assert.hpp>
  22. #include <boost/type_traits/is_array.hpp>
  23. template< typename T >
  24. void check(T& param)
  25. {
  26. BOOST_STATIC_ASSERT(boost::is_array< T >::value);
  27. }
  28. int main(int, char*[])
  29. {
  30. check(BOOST_CURRENT_FUNCTION);
  31. return 0;
  32. }