1 | |
---|---|
2 | // Copyright (C) 2009-2012 Lorenzo Caminiti |
3 | // Distributed under the Boost Software License, Version 1.0 |
4 | // (see accompanying file LICENSE_1_0.txt or a copy at |
5 | // http://www.boost.org/LICENSE_1_0.txt) |
6 | // Home at http://www.boost.org/libs/local_function |
7 | |
8 | #include <boost/local_function.hpp> |
9 | |
10 | int error(int x, int y) { |
11 | int BOOST_LOCAL_FUNCTION( (int z) ) { |
12 | if(z > 0) goto success; |
13 | return -1; |
14 | success: |
15 | return 0; |
16 | } BOOST_LOCAL_FUNCTION_NAME(validate) |
17 | |
18 | return validate(x + y); |
19 | } |
20 | |
21 | int main(void) { |
22 | error(x: 1, y: 2); |
23 | return 0; |
24 | } |
25 | |
26 |