Files
assert/doc/current_function.adoc

32 lines
1.1 KiB
Plaintext
Raw Normal View History

2017-06-05 18:20:02 +03:00
////
Copyright 2002, 2017 Peter Dimov
Distributed under the Boost Software License, Version 1.0.
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
////
2019-11-26 02:18:34 +02:00
[#current_function_macro]
# Current Function Macro, <boost/current_function.hpp>
2017-06-05 18:30:45 +03:00
:toc:
2017-06-05 18:36:26 +03:00
:toc-title:
2017-06-06 02:19:26 +03:00
:idprefix:
2017-06-05 18:30:45 +03:00
2017-06-05 18:20:02 +03:00
## BOOST_CURRENT_FUNCTION
2017-06-05 18:23:12 +03:00
The header `<boost/current_function.hpp>` defines a single macro, `BOOST_CURRENT_FUNCTION`,
similar to the C99 predefined identifier `\\__func__`.
2017-06-05 18:20:02 +03:00
`BOOST_CURRENT_FUNCTION` expands to a string literal containing
the (fully qualified, if possible) name of the enclosing function. If there is
no enclosing function, the behavior is unspecified.
Some compilers do not provide a way to obtain the name of the current enclosing
2017-06-05 18:53:28 +03:00
function. On such compilers, or when the macro `BOOST_DISABLE_CURRENT_FUNCTION`
is defined, `BOOST_CURRENT_FUNCTION` expands to `"(unknown)"`.
`BOOST_DISABLE_CURRENT_FUNCTION` addresses a use case in which the programmer
wishes to eliminate the string literals produced by `BOOST_CURRENT_FUNCTION` from
the final executable for security reasons.