]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/doc/qi/num_list3.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / spirit / doc / qi / num_list3.qbk
1 [/==============================================================================
2 Copyright (C) 2001-2011 Joel de Guzman
3 Copyright (C) 2001-2011 Hartmut Kaiser
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ===============================================================================/]
8
9 [section Number List Redux - list syntax]
10
11
12 So far, we've been using the syntax:
13
14 double_ >> *(',' >> double_)
15
16 to parse a comma-delimited list of numbers. Such lists are common in parsing and
17 Spirit provides a simpler shortcut for them. The expression above can be
18 simplified to:
19
20 double_ % ','
21
22 read as: a list of doubles separated by `','`.
23
24
25 This sample, again a variation of our previous example, demonstrates just that:
26
27 [import ../../example/qi/num_list3.cpp]
28
29 [tutorial_numlist3]
30
31 The full cpp file for this example can be found here: [@../../example/qi/num_list3.cpp]
32
33 [endsect]