]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/phoenix/example/fundamental/sample2.cpp
1 /*=============================================================================
3 Copyright (c) 2001-2003 Joel de Guzman
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 ==============================================================================*/
12 #include <boost/spirit/include/phoenix1_operators.hpp>
13 #include <boost/spirit/include/phoenix1_primitives.hpp>
16 using namespace phoenix
;
21 int init
[] = { 2, 10, 4, 5, 1, 6, 8, 3, 9, 7 };
22 vector
<int> c(init
, init
+ 10);
23 typedef vector
<int>::iterator iterator
;
25 // Find the first odd number in container c
26 iterator it
= find_if(c
.begin(), c
.end(), arg1
% 2 == 1);
29 cout
<< *it
; // if found, print the result