1 2 // Copyright (C) 2006-2009, 2012 Alexander Nasonov 3 // Copyright (C) 2012 Lorenzo Caminiti 4 // Distributed under the Boost Software License, Version 1.0 5 // (see accompanying file LICENSE_1_0.txt or a copy at 6 // http://www.boost.org/LICENSE_1_0.txt) 7 // Home at http://www.boost.org/libs/scope_exit 8 9 #include <boost/scope_exit.hpp> 10 #include <boost/typeof/typeof.hpp> 11 #include <boost/typeof/std/string.hpp> 12 #include <string> 13 main(void)14int main(void) { 15 std::string const volatile s; 16 BOOST_SCOPE_EXIT( (&s) ) { 17 s = ""; 18 } BOOST_SCOPE_EXIT_END 19 } 20 21