• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "const_block.hpp"
9 #include <cassert>
10 
main(void)11 int main(void) {
12     //[const_block
13     int x = 1, y = 2;
14     CONST_BLOCK(x, y) { // Constant block.
15         assert(x = y);  // Compiler error.
16     } CONST_BLOCK_END
17     //]
18     return 0;
19 }
20 
21