• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1////
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]
11# Current Function Macro, <boost/current_function.hpp>
12:toc:
13:toc-title:
14:idprefix:
15
16## BOOST_CURRENT_FUNCTION
17
18The header `<boost/current_function.hpp>` defines a single macro, `BOOST_CURRENT_FUNCTION`,
19similar to the C99 predefined identifier `\\__func__`.
20
21`BOOST_CURRENT_FUNCTION` expands to a string literal containing
22the (fully qualified, if possible) name of the enclosing function. If there is
23no enclosing function, the behavior is unspecified.
24
25Some compilers do not provide a way to obtain the name of the current enclosing
26function. On such compilers, or when the macro `BOOST_DISABLE_CURRENT_FUNCTION`
27is defined, `BOOST_CURRENT_FUNCTION` expands to `"(unknown)"`.
28
29`BOOST_DISABLE_CURRENT_FUNCTION` addresses a use case in which the programmer
30wishes to eliminate the string literals produced by `BOOST_CURRENT_FUNCTION` from
31the final executable for security reasons.
32