blob: 9235c1a181098905de978a6aab177ee17a456cca [file] [log] [blame]
Brian Silvermanea861c12018-08-04 17:43:02 -07001////
2Copyright 2002, 2017 Peter Dimov
3
4Distributed under the Boost Software License, Version 1.0.
5
6See accompanying file LICENSE_1_0.txt or copy at
7http://www.boost.org/LICENSE_1_0.txt
8////
9
10# Current Function Macro, <boost/current_function.hpp>
11:toc:
12:toc-title:
13:idprefix:
14
15## BOOST_CURRENT_FUNCTION
16
17The header `<boost/current_function.hpp>` defines a single macro, `BOOST_CURRENT_FUNCTION`,
18similar to the C99 predefined identifier `\\__func__`.
19
20`BOOST_CURRENT_FUNCTION` expands to a string literal containing
21the (fully qualified, if possible) name of the enclosing function. If there is
22no enclosing function, the behavior is unspecified.
23
24Some compilers do not provide a way to obtain the name of the current enclosing
25function. On such compilers, or when the macro `BOOST_DISABLE_CURRENT_FUNCTION`
26is defined, `BOOST_CURRENT_FUNCTION` expands to `"(unknown)"`.
27
28`BOOST_DISABLE_CURRENT_FUNCTION` addresses a use case in which the programmer
29wishes to eliminate the string literals produced by `BOOST_CURRENT_FUNCTION` from
30the final executable for security reasons.