]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/convert/doc/tools.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / convert / doc / tools.qbk
CommitLineData
7c673cae
FG
1[/
2 Copyright (c) Vladimir Batov 2009-2016
3 Distributed under the Boost Software License, Version 1.0.
4 See copy at http://www.boost.org/LICENSE_1_0.txt.
5]
6
7[section:supporting_tools Supporting Tools]
8
9This section describes a few supporting tools written as part of ['Boost.Convert] but which might be useful in their own rights.
10
11[section BOOST_DECLARE_HAS_MEMBER]
12
13The BOOST_DECLARE_HAS_MEMBER macro allows to declare a trait which would then let introspect the existence of a class member (a data member or a member function) with the specified name.
14
15For example, the following declarations introduce `local::has_begin` and `local::has_funop` traits which then allow to test if the supplied class has respectively `begin` and `operator()` members:
16
17[has_member_declaration]
18
19Now these traits can be used as follows:
20
21[has_member_classes_tested]
22[has_member_usage]
23
24As it can be seen from the example the traits only check for the existence of a member (be that a data member or a member function) with the specified name.
25
26[endsect]
27[section BOOST_DECLARE_IS_CALLABLE]
28
29The BOOST_DECLARE_IS_CALLABLE macro extends the functonality provided by BOOST_DECLARE_HAS_MEMBER and allows to declare a trait which would then let introspect the existence of a named class member function ['callable with the supplied signature].
30
31For example, the following declarations introduce `local::can_call_funop` and `local::can_call_func` traits:
32
33[is_callable_declaration]
34
35The traits allow to test if the supplied class has respectively `operator()` and `func()` member functions callable with the specified signature:
36
37[is_callable_classes_tested]
38[is_callable_usage1]
39[is_callable_usage2]
40
41As it can be seen from the example the traits check for the existence of a ['callable] member function but ['not necessarily of the specified signature]. Please check the ['Boost.TTI] library for the latter.
42
43[endsect]
44[section boost::cnv::range]
45
46['boost::cnv::range] is a consolidation of the [begin, end)-based ranges (such as ['std::string]) and the sentry-based ranges (such as null-terminated C-style strings). It allows universal traversal of both types of ranges with
47
48 for (iterator s = range.begin(); s != range.sentry(); ++s)
49
50without the penalty or the need for an extra traversal of the sentry-based ranges in order to find the end.
51
52TODO
53
54[endsect]
55[section boost::cnv::is_range]
56
57TODO
58
59[endsect]
60[section boost::cnv::is_cnv]
61
62TODO
63
64[endsect]
65[endsect]
66