diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/scope_exit/test/tu_test.hpp | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/scope_exit/test/tu_test.hpp')
-rw-r--r-- | src/boost/libs/scope_exit/test/tu_test.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/boost/libs/scope_exit/test/tu_test.hpp b/src/boost/libs/scope_exit/test/tu_test.hpp new file mode 100644 index 000000000..25b9a1c6a --- /dev/null +++ b/src/boost/libs/scope_exit/test/tu_test.hpp @@ -0,0 +1,48 @@ + +// Copyright (C) 2006-2009, 2012 Alexander Nasonov +// Copyright (C) 2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/scope_exit + +// No #include guard for this header. + +#include <boost/scope_exit.hpp> +#include <boost/config.hpp> + +int tu1(void); +int tu2(void); + +inline int inline_f(void) { + int i = 99; + { + BOOST_SCOPE_EXIT( (&i) ) { + i = -1; + } BOOST_SCOPE_EXIT_END + } + return i; +} + +#if !defined(BOOST_INTEL) && defined(__GNUC__) && \ + (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 +template<class Int> +Int template_f(Int i) { + { + BOOST_SCOPE_EXIT_TPL( (&i) ) { + ++i; + } BOOST_SCOPE_EXIT_END + } + return i; +} +#else +inline int template_f(int i) { + { + BOOST_SCOPE_EXIT( (&i) ) { + ++i; + } BOOST_SCOPE_EXIT_END + } + return i; +} +#endif + |