]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/example/techniques/typeof.cpp
1 /*=============================================================================
2 Copyright (c) 2002-2003 Joel de Guzman
3 http://spirit.sourceforge.net/
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
10 // *** See the section "typeof" in chapter "Techniques" of
11 // *** the Spirit documentation for information regarding
15 #include <boost/spirit/include/classic_core.hpp>
16 #include <boost/typeof/typeof.hpp>
17 #include <boost/assert.hpp>
19 using namespace BOOST_SPIRIT_CLASSIC_NS
;
21 #define RULE(name, definition) BOOST_TYPEOF(definition) name = definition
29 | "//" >> *(anychar_p
- '\n') >> '\n'
30 | "/*" >> *(anychar_p
- "*/") >> "*/"
35 "/*this is a comment*/\n//this is a c++ comment\n\n",
37 BOOST_ASSERT(success
);
38 std::cout
<< "SUCCESS!!!\n";