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 20 #define BOOST_TEST_MODULE current_function_support 21 22 #include <boost/current_function.hpp> 23 #include <boost/static_assert.hpp> 24 #include <boost/type_traits/is_array.hpp> 25 26 template< typename T > check(T & param)27void check(T& param) 28 { 29 BOOST_STATIC_ASSERT(boost::is_array< T >::value); 30 } 31 main(int,char * [])32int main(int, char*[]) 33 { 34 check(BOOST_CURRENT_FUNCTION); 35 36 return 0; 37 } 38