Ticket #6756: main.cpp

File main.cpp, 574 bytes (added by Lin, Yi-Li <record.nctu.cis91@…>, 11 years ago)
Line 
1#include <boost/scope_exit.hpp>
2
3#define SHOW_ERROR
4
5#ifdef SHOW_ERROR
6template< typename the_argument_type>
7inline the_argument_type do_exit_scope( the_argument_type the_argument_value) {
8 int value = 0;
9
10 BOOST_SCOPE_EXIT( ( &value)) {
11 value = 123;
12 } BOOST_SCOPE_EXIT_END;
13
14 return the_argument_value;
15}
16#else
17inline int do_exit_scope( int the_argument_value) {
18 int value = 0;
19
20 BOOST_SCOPE_EXIT( ( &value)) {
21 value = 123;
22 } BOOST_SCOPE_EXIT_END;
23
24 return the_argument_value;
25}
26#endif
27
28int main( int argc, char **argv) {
29 return 0;
30}