]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/test/symbols_find_null.cpp
1 /*=============================================================================
2 Copyright (c) 2004 Joao Abecasis
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 #include <boost/spirit/include/classic_scanner.hpp>
11 #include <boost/spirit/home/classic/symbols/impl/tst.ipp>
12 #include <boost/utility/addressof.hpp>
14 typedef char char_type
;
15 typedef char const * iterator
;
17 char_type data_
[] = "whatever";
19 iterator begin
= data_
;
21 + sizeof(data_
)/sizeof(char_type
); // Yes, this is an intencional bug ;)
25 typedef BOOST_SPIRIT_CLASSIC_NS::scanner
<> scanner
;
26 typedef BOOST_SPIRIT_CLASSIC_NS::impl::tst
<void *, char_type
> symbols
;
30 symbols_
.add(begin
, end
- 1, (void*) boost::addressof(symbols_
));
32 // The symbol table parser should not choke on input containing the null
34 symbols_
.find(scanner(begin
, end
));