1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 The Boost Parameter Library Reference Documentation
3 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 :Authors: David Abrahams, Daniel Wallin
6 :Contact: dave@boost-consulting.com, daniel@boostpro.com
7 :organization: `BoostPro Computing`_
8 :date: $Date: 2005/07/17 19:53:01 $
10 :copyright: Copyright David Abrahams, Daniel Wallin
11 2005-2009. Distributed under the Boost Software License,
12 Version 1.0. (See accompanying file LICENSE_1_0.txt
13 or copy at http://www.boost.org/LICENSE_1_0.txt)
17 .. |(logo)| image:: ../../../../boost.png
20 __ ../../../../index.htm
22 .. _`BoostPro Computing`: http://www.boostpro.com
25 //////////////////////////////////////////////////////////////////////////////
30 //////////////////////////////////////////////////////////////////////////////
41 .. |ArgumentPack| replace:: :concept:`ArgumentPack`
42 .. |ForwardSequence| replace:: :concept:`Forward Sequence`
43 .. |ParameterSpec| replace:: :concept:`ParameterSpec`
48 .. section-numbering::
54 This section covers some basic information you'll need to know in order to
55 understand this reference.
60 In this document, all unqualified identifiers should be assumed to be defined
61 in namespace ``boost::parameter`` unless otherwise specified.
66 No operation described in this document throws an exception unless otherwise
72 All components of this library can be used safely from multiple threads
73 without synchronization. [#thread]_
78 Names written in :concept:`sans serif type` represent concepts_.
80 In code blocks, *italic type* represents unspecified text that satisfies the
81 requirements given in the detailed description that follows the code block.
83 In a specification of the tokens generated by a macro, **bold type** is used
84 to highlight the position of the expanded macro argument in the result.
86 The special character β represents the value of |BOOST_PARAMETER_MAX_ARITY|_.
88 //////////////////////////////////////////////////////////////////////////////
93 .. |kw| replace:: keyword
97 The name of a function parameter.
100 .. |keyword tag type| replace:: `keyword tag type`_
103 A type used to uniquely identify a function parameter. Typically its name
104 will be the same as that of the parameter.
107 .. |positional| replace:: `positional`_
110 An argument passed with no explicit |kw|. Its parameter is determined
111 in the usual C++ way: by position with respect to a parameter list.
114 .. |tag type| replace:: `tag type`_
117 Shorthand for “\ |keyword tag type|.”
120 .. |keyword object| replace:: `keyword object`_
123 An instance of |keyword|_\ ``<T>`` for some |tag type| ``T``.
125 .. _tagged reference:
126 .. |tagged reference| replace:: `tagged reference`_
129 An object whose type is associated with a |keyword tag type| (the object's
130 *keyword*), and that holds a reference (to the object's *value*).
132 As a shorthand, a “tagged reference to ``x``\ ” means a tagged reference
133 whose *value* is ``x``.
136 .. |tagged default| replace:: `tagged default`_
139 A |tagged reference| whose *value* represents the value of a
142 .. _tagged lazy default:
143 .. |tagged lazy default| replace:: `tagged lazy default`_
146 A |tagged reference| whose *value*, when invoked with no arguments,
147 computes a default argument value.
149 .. _intended argument type:
150 .. |intended argument type| replace:: `intended argument type`_
152 intended argument type
153 The *intended argument type* of a single-element |ArgumentPack|_ is the
154 type of its element's *value*. The intended argument type of any other
155 type ``X`` is ``X`` itself.
159 In this reference, we will use concept names (and other names) to describe
160 both types and objects, depending on context. So for example, “an
161 |ArgumentPack|_\ ” can refer to a type that models |ArgumentPack|_
162 *or* an object of such a type.
164 //////////////////////////////////////////////////////////////////////////////
169 This section describes the generic type concepts used by the Parameter
175 An |ArgumentPack| is a collection of |tagged reference|\ s to the actual
176 arguments passed to a function. Every |ArgumentPack| is also a valid `MPL
177 Forward Sequence`_ and `MPL Associative Sequence`_ consisting of the |keyword
178 tag type|\ s in its |tagged reference|\ s. If |BOOST_PARAMETER_CAN_USE_MP11|
179 is defined, then every |ArgumentPack| is also a valid |Boost_MP11|_ map whose
180 keys are |keyword tag type|\ s. The |singular_cpp|_, |compose_cpp|_, and
181 |mpl_cpp|_ test programs demonstrate this functionality.
188 * ``A`` is a model of |ArgumentPack|
189 * ``x`` is an instance of ``A``
190 * ``u`` is a |keyword object| of type ``K``
191 * ``v`` is a |tagged default| with |tag type| ``L`` and *value* of type ``D``
192 * ``w`` is a |tagged lazy default| with |tag type| ``M`` and *value* of type ``E const``
193 * ``z`` is an |ArgumentPack| containing a single element (as created by |keyword|_\ ``<…>::operator=``)
195 Any exceptions thrown from the invocation of ``w``\ 's *value*
196 will be propagated to the caller.
198 .. table:: |ArgumentPack| requirements
200 +------------+---------------------------------+----------------+----------------------+
201 | Expression | Type | Requirements | Semantics/Notes |
202 +============+=================================+================+======================+
203 | ``x[u]`` | ``binding<A, K>::type`` | ``x`` contains | Returns *b*\ 's |
204 | | | an element *b* | *value* (by |
205 | | | whose |kw|_ is | reference). |
207 +------------+---------------------------------+----------------+----------------------+
208 | ``x[u]`` | ``binding<A, L, D>::type`` | *none* | If ``x`` contains an |
209 | | | | element *b* whose |
210 | | | | |kw|_ is the same as |
211 | | | | ``u``\ 's, returns |
212 | | | | *b*\ 's *value* (by |
213 | | | | reference). |
214 | | | | Otherwise, returns |
215 | | | | ``u``\ 's *value*. |
216 +------------+---------------------------------+----------------+----------------------+
217 | ``x[w]`` | ``lazy_binding<A, M, E>::type`` | *none* | If ``x`` contains an |
218 | | | | element *b* whose |
219 | | | | |kw|_ is the same as |
220 | | | | ``w``\ 's, returns |
221 | | | | *b*\ 's *value* (by |
222 | | | | reference). |
223 | | | | Otherwise, invokes |
224 | | | | ``w``\ 's *value* |
225 | | | | and returns the |
227 +------------+---------------------------------+----------------+----------------------+
228 | ``x, z`` | Model of |ArgumentPack|_ | *none* | Returns an |
229 | | | | |ArgumentPack|_ |
230 | | | | containing all the |
231 | | | | elements of both |
232 | | | | ``x`` and ``z``. |
233 +------------+---------------------------------+----------------+----------------------+
240 A |ParameterSpec| describes the type requirements for arguments corresponding
241 to a given |kw|_ and indicates whether the argument is optional or
242 required. The table below details the allowed forms and describes their
243 condition for satisfaction by an actual argument type. In each row,
247 * ``K`` is the |ParameterSpec|\ 's |keyword tag type|
248 * ``A`` is an |intended argument type| associated with ``K``, if any
249 * ``P`` is a model of |ArgumentPack| that contains ``A``
250 * ``F`` is an `MPL Binary Metafunction Class`_
252 .. _`MPL Binary Metafunction Class`: ../../../mpl/doc/refmanual/metafunction-class.html
254 .. table:: |ParameterSpec| allowed forms and conditions of satisfaction
256 +------------------------+----------+----------------------------------------+
257 | Type | ``A`` | Condition ``A`` must satisfy |
259 +========================+==========+========================================+
260 | ``K`` | no | *n/a* |
261 +------------------------+----------+----------------------------------------+
262 | |optional|_\ ``<K,F>`` | no | ``mpl::apply2<F,A,P>::type::value`` is |
264 +------------------------+----------+----------------------------------------+
265 | |required|_\ ``<K,F>`` | yes | ``mpl::apply2<F,A,P>::type::value`` is |
267 +------------------------+----------+----------------------------------------+
269 The information in a |ParameterSpec| is used to `limit`__ the arguments that
270 will be matched by `forwarding functions`_.
273 .. _overloadcontrol: index.html#controlling-overload-resolution
274 .. _forwarding functions: index.html#forwarding-functions
276 //////////////////////////////////////////////////////////////////////////////
281 .. |keyword| replace:: ``keyword``
287 The type of every |keyword object| is a specialization of |keyword|.
289 :Defined in: |keyword_header|_
293 template <typename Tag>
298 template <typename T>
299 constexpr typename |boost_enable_if|_\<
300 typename |mpl_eval_if|_\<
301 |boost_is_scalar|_\<T>
302 , |mpl_true|_\ // Enable this overload for scalar types.
305 typename Tag\:\:qualifier
306 , boost::parameter::in_reference
308 , |mpl_true|_\ // Enable this overload for "in" references.
311 typename Tag\:\:qualifier
312 , boost::parameter::forward_reference
314 , |mpl_true|_\ // Enable this overload for "forward" references.
315 , |mpl_false|_\ // Disable this overload for all other reference categories.
321 |assignment operator|_\(T const& value) const;
323 template <typename T>
324 constexpr typename |boost_enable_if|_\<
325 typename |mpl_eval_if|_\<
326 typename |mpl_eval_if|_\<
328 typename Tag\:\:qualifier
329 , boost::parameter::out_reference
331 , |mpl_true|_\ // The reference category is "out".
334 typename Tag\:\:qualifier
335 , boost::parameter::forward_reference
337 , |mpl_true|_\ // The reference category is "forward".
338 , |mpl_false|_\ // The reference category is neither "out" nor "forward".
342 |boost_is_const|_\<T>
343 , |mpl_false|_\ // Disable this overload for reference-to-const types.
344 , |mpl_true|_\ // Enable this overload for referece-to-mutable types.
346 , |mpl_false|_\ // Disable this overload for references neither "out" nor "forward".
350 |assignment operator|_\(T& value) const;
352 template <typename T>
353 constexpr typename |boost_enable_if|_\<
354 typename |mpl_eval_if|_\<
355 |boost_is_scalar|_\<T>
356 , |mpl_false|_\ // Disable this overload for scalar types.
359 typename Tag\:\:qualifier
360 , boost::parameter::in_reference
362 , |mpl_true|_\ // Enable this overload for "in" references.
365 typename Tag\:\:qualifier
366 , boost::parameter::forward_reference
368 , |mpl_true|_\ // Enable this overload for "forward" references.
369 , |mpl_false|_\ // Disable this overload for all other reference categories.
375 |assignment operator|_\(T const&& value) const;
377 template <typename T>
378 constexpr typename |boost_enable_if|_\<
379 typename |mpl_eval_if|_\<
380 |boost_is_scalar|_\<T>
381 , |mpl_false|_\ // Disable this overload for scalar types.
384 typename Tag\:\:qualifier
385 , boost::parameter::consume_reference
387 , |mpl_true|_\ // Enable this overload for "consume" references.
390 typename Tag\:\:qualifier
391 , boost::parameter::forward_reference
393 , |mpl_true|_\ // Enable this overload for "forward" references.
394 , |mpl_false|_\ // Disable this overload for all other reference categories.
400 |assignment operator|_\(T&& value) const;
402 template <typename T>
403 constexpr typename |boost_enable_if|_\<
404 typename |mpl_eval_if|_\<
405 |boost_is_scalar|_\<T>
406 , |mpl_true|_\ // Enable this overload for scalar types.
409 typename Tag\:\:qualifier
410 , boost::parameter::in_reference
412 , |mpl_true|_\ // Enable this overload for "in" references.
415 typename Tag\:\:qualifier
416 , boost::parameter::forward_reference
418 , |mpl_true|_\ // Enable this overload for "forward" references.
419 , |mpl_false|_\ // Disable this overload for all other reference categories.
425 |bitwise or operator|_\(T const& x) const;
427 template <typename T>
428 constexpr typename |boost_enable_if|_\<
429 typename |mpl_eval_if|_\<
430 typename |mpl_eval_if|_\<
432 typename Tag\:\:qualifier
433 , boost::parameter::out_reference
435 , |mpl_true|_\ // The reference category is "out".
438 typename Tag\:\:qualifier
439 , boost::parameter::forward_reference
441 , |mpl_true|_\ // The reference category is "forward".
442 , |mpl_false|_\ // The reference category is neither "out" nor "forward".
446 |boost_is_const|_\<T>
447 , |mpl_false|_\ // Disable this overload for reference-to-const types.
448 , |mpl_true|_\ // Enable this overload for referece-to-mutable types.
450 , |mpl_false|_\ // Disable this overload for references neither "out" nor "forward".
454 |bitwise or operator|_\(T& x) const;
456 template <typename T>
457 constexpr typename |boost_enable_if|_\<
458 typename |mpl_eval_if|_\<
459 |boost_is_scalar|_\<T>
460 , |mpl_false|_\ // Disable this overload for scalar types.
463 typename Tag\:\:qualifier
464 , boost::parameter::in_reference
466 , |mpl_true|_\ // Enable this overload for "in" references.
469 typename Tag\:\:qualifier
470 , boost::parameter::forward_reference
472 , |mpl_true|_\ // Enable this overload for "forward" references.
473 , |mpl_false|_\ // Disable this overload for all other reference categories.
479 |bitwise or operator|_\(T const&& x) const;
481 template <typename T>
482 constexpr typename |boost_enable_if|_\<
483 typename |mpl_eval_if|_\<
484 |boost_is_scalar|_\<T>
485 , |mpl_false|_\ // Disable this overload for scalar types.
488 typename Tag\:\:qualifier
489 , boost::parameter::consume_reference
491 , |mpl_true|_\ // Enable this overload for "consume" references.
494 typename Tag\:\:qualifier
495 , boost::parameter::forward_reference
497 , |mpl_true|_\ // Enable this overload for "forward" references.
498 , |mpl_false|_\ // Disable this overload for all other reference categories.
504 |bitwise or operator|_\(T&& value) const;
506 template <typename F>
507 constexpr *tagged lazy default* |logical or operator|_\(F const&) const;
509 template <typename F>
510 constexpr *tagged lazy default* |logical or operator|_\(F&) const;
512 static keyword<Tag> const& instance;
514 static keyword<Tag>& get_\();
517 .. |assignment operator| replace:: ``operator=``
518 .. _assignment operator:
526 template <typename T>
527 constexpr |ArgumentPack|_ operator=(T const& value) const;
529 template <typename T>
530 constexpr |ArgumentPack|_ operator=(T& value) const;
532 template <typename T>
533 constexpr |ArgumentPack|_ operator=(T const&& value) const;
535 template <typename T>
536 constexpr |ArgumentPack|_ operator=(T&& value) const;
538 :Requires: one of the following:
540 * The nested ``qualifier`` type of ``Tag`` must be ``forward_reference``.
541 * To use the ``const`` lvalue reference overload, ``T`` must be scalar, or
542 the nested ``qualifier`` type of ``Tag`` must be ``in_reference``.
543 * To use the mutable lvalue reference overload, the nested ``qualifier``
544 type of ``Tag`` must be ``out_reference`` or ``in_out_reference``, and
545 ``T`` must not be ``const``-qualified.
546 * To use the ``const`` rvalue reference overload for non-scalar ``T``, the
547 nested ``qualifier`` type of ``Tag`` must be ``in_reference``.
548 * To use the mutable rvalue reference overload for non-scalar ``T``, the
549 nested ``qualifier`` type of ``Tag`` must be ``consume_reference`` or
550 ``move_from_reference``.
552 :Returns: an |ArgumentPack|_ containing a single |tagged reference| to
553 ``value`` with |kw|_ ``Tag``
555 .. |bitwise or operator| replace:: ``operator|``
556 .. _bitwise or operator:
564 template <typename T>
565 constexpr *tagged default* operator|(T const& x) const;
567 template <typename T>
568 constexpr *tagged default* operator|(T& x) const;
570 template <typename T>
571 constexpr *tagged default* operator|(T const&& x) const;
573 template <typename T>
574 constexpr *tagged default* operator|(T&& x) const;
576 :Requires: one of the following:
578 * The nested ``qualifier`` type of ``Tag`` must be ``forward_reference``.
579 * To use the ``const`` lvalue reference overload, ``T`` must be scalar, or
580 the nested ``qualifier`` type of ``Tag`` must be ``in_reference``.
581 * To use the mutable lvalue reference overload, the nested ``qualifier``
582 type of ``Tag`` must be ``out_reference`` or ``in_out_reference``, and
583 ``T`` must not be ``const``-qualified.
584 * To use the ``const`` rvalue reference overload for non-scalar ``T``, the
585 nested ``qualifier`` type of ``Tag`` must be ``in_reference``.
586 * To use the mutable rvalue reference overload for non-scalar ``T``, the
587 nested ``qualifier`` type of ``Tag`` must be ``consume_reference`` or
588 ``move_from_reference``.
590 :Returns: a |tagged default| with *value* ``x`` and |kw|_ ``Tag``.
592 .. |logical or operator| replace:: ``operator||``
593 .. _logical or operator:
601 template <typename F>
602 constexpr *tagged lazy default* operator||(F const& g) const;
604 template <typename F>
605 constexpr *tagged lazy default* operator||(F& g) const;
607 :Requires: ``g()`` must be valid, with type
608 |boost_result_of|_\ ``<F()>::type``. [#no_result_of]_
610 :Returns: a |tagged lazy default| with *value* ``g`` and |kw|_ ``Tag``.
620 static keyword<Tag> const& instance;
622 :Returns: a “singleton instance”: the same object will be returned on each
623 invocation of ``instance``.
626 ``instance`` can be accessed from multiple threads simultaneously.
636 static keyword<Tag>& get\();
638 .. admonition:: Deprecated
640 This function has been deprecated in favor of ``instance``.
642 :Returns: a “singleton instance”: the same object will be returned on each
643 invocation of ``get()``.
645 :Thread Safety: ``get()`` can be called from multiple threads simultaneously.
647 .. |template_keyword| replace:: ``template_keyword``
648 .. _template_keyword:
653 This class template encapsulates a named template parameter. Every type
654 generated by the |BOOST_PARAMETER_TEMPLATE_KEYWORD|_ macro is a specialization
655 of |template_keyword|.
657 :Defined in: |template_keyword_header|_
661 template <typename Tag, typename T>
662 struct template_keyword
664 typedef Tag key_type;
665 typedef T value_type;
666 typedef *implementation defined* reference;
669 The |ntp_cpp|_ test program demonstrates proper usage of this class template.
671 .. |parameters| replace:: ``parameters``
677 Provides an interface for assembling the actual arguments to a `forwarding
678 function` into an |ArgumentPack|, in which any |positional| arguments will be
679 tagged according to the corresponding template argument to ``parameters``.
681 .. _forwarding function: `forwarding functions`_
683 :Defined in: |parameters_header|_
687 template <typename ...PSpec>
690 template <typename ...Args>
696 template <typename ...Args>
697 |ArgumentPack|_ |function call operator|_\(Args&&... args) const;
700 :Requires: Each element in the ``PSpec`` parameter pack must be a model of
705 In this section, ``R`` ## *i* and ``K`` ## *i* are defined as
706 follows, for any argument type ``A`` ## *i*:
708 | let ``D0`` the set [d0, …, d ## *j*] of all **deduced**
709 | *parameter specs* in the ``PSpec`` parameter pack
710 | ``R`` ## *i* is the |intended argument type| of ``A`` ## *i*
712 | if ``A`` ## *i* is a result type of ``keyword<T>::`` |assignment operator|_
714 | ``K`` ## *i* is ``T``
716 | if some ``A`` ## *j* where *j* ≤ *i* is a result type of
717 | ``keyword<T>::`` |assignment operator|_
718 | *or* some ``P`` ## *j* in *j* ≤ *i* is **deduced**
720 | if some *parameter spec* ``d`` ## *j* in ``D`` ## *i*
721 | matches ``A`` ## *i*
723 | ``K`` ## *i* is the |keyword tag type| of ``d`` ## *j*.
724 | ``D``:sub:`i+1` is ``D`` ## *i* - [ ``d`` ## *j*]
726 | ``K`` ## *i* is the |keyword tag type| of ``P`` ## *i*.
728 .. |match| replace:: ``match``
732 A `Metafunction`_ used to remove a `forwarding function`_ from overload
735 :Returns: if all elements in ``Params...`` are *satisfied* (see below), then
736 ``parameters<Params...>``. Otherwise, ``match<Args...>::type`` is not
739 Each element ``P`` in ``Params...`` is **satisfied** if either:
741 * ``P`` is the *unspecified* default
742 * **or**, ``P`` is a *keyword tag type*
743 * **or**, ``P`` is |optional|_ ``<X,F>`` and either
744 - ``X`` is not ``K`` ## *i* for any *i*,
745 - **or** ``X`` is some ``K`` ## *i* and ``mpl::apply<F,R`` ## *i*\
746 ``>::type::value`` is ``true``
747 * **or**, ``P`` is |required|_ ``<X,F>``, and
748 - ``X`` is some ``K`` ## *i*, **and**
749 - ``mpl::apply<F,R`` ## *i* ``>::type::value`` is ``true``
751 .. |function call operator| replace:: ``operator()``
752 .. _function call operator:
760 template <typename ...Args>
761 |ArgumentPack|_ operator()(Args&&... args) const;
763 :Returns: An |ArgumentPack|_ containing, for each ``a`` ## *i*,
765 - if ``a`` ## *i* is a single-element |ArgumentPack|, its element
766 - Otherwise, a |tagged reference| with |kw|_ ``K`` ## *i* and *value*
769 .. |optional| replace:: ``optional``
770 .. |required| replace:: ``required``
775 ``optional``, ``required``
776 --------------------------
778 These templates describe the requirements on a function parameter.
780 ``optional`` is defined in: |optional_header|_
782 ``required`` is defined in: |required_header|_
784 Both headers are included by: |preprocessor_header|_
786 :Specializations model: |ParameterSpec|_
790 template <typename Tag, typename Predicate = *unspecified*>
793 template <typename Tag, typename Predicate = *unspecified*>
796 The default value of ``Predicate`` is an unspecified `MPL Binary Metafunction
797 Class`_ that returns ``mpl::true_`` for any argument. If
798 |BOOST_PARAMETER_CAN_USE_MP11|_ is defined, then the default value of
799 ``Predicate`` is also a |Boost_MP11|_-style quoted metafunction that returns
800 ``mp11::mp_true`` for any argument.
802 .. |deduced| replace:: ``deduced``
808 This template is used to wrap the *keyword tag* argument to
809 ``optional`` or ``required``.
811 :Defined in: |deduced_header|_
812 :Included by: |preprocessor_header|_
816 template <typename Tag>
821 //////////////////////////////////////////////////////////////////////////////
826 A `Metafunction`_ is conceptually a function that operates on, and returns,
829 .. |binding| replace:: ``binding``
835 Returns the result type of indexing an argument pack with a
836 |keyword tag type| or with a |tagged default|.
838 :Defined in: |binding_header|_
842 template <typename A, typename K, typename D = void\_>
848 :Requires: ``A`` must be a model of |ArgumentPack|_.
850 :Returns: the reference type of the |tagged reference| in ``A`` having
851 |keyword tag type| ``K``, if any. If no such |tagged reference| exists,
854 .. |lazy_binding| replace:: ``lazy_binding``
860 Returns the result type of indexing an argument pack with a
861 |tagged lazy default|.
863 :Defined in: |binding_header|_
867 template <typename A, typename K, typename F>
873 :Requires: ``A`` must be a model of |ArgumentPack|_.
875 :Returns: the reference type of the |tagged reference| in ``A`` having
876 |keyword tag type| ``K``, if any. If no such |tagged reference| exists,
877 returns |boost_result_of|_\ ``<F()>::type``. [#no_result_of]_
879 .. |value_type| replace:: ``value_type``
885 Returns the result type of indexing an argument pack with a
886 |keyword tag type| or with a |tagged default|.
888 :Defined in: |value_type_header|_
892 template <typename A, typename K, typename D = void\_>
898 :Requires: ``A`` must be a model of |ArgumentPack|_.
900 :Returns: the (possibly const-qualified) type of the |tagged reference| in
901 ``A`` having |keyword tag type| ``K``, if any. If no such
902 |tagged reference| exists, returns ``D``. Equivalent to:
906 typename |boost_remove_reference|_\<
907 typename |binding|_\<A, K, D>::type
910 … when ``D`` is not a reference type.
912 .. |lazy_value_type| replace:: ``lazy_value_type``
918 Returns the result type of indexing an argument pack with a
919 |tagged lazy default|.
921 :Defined in: |value_type_header|_
925 template <typename A, typename K, typename F>
926 struct lazy_value_type
931 :Requires: ``A`` must be a model of |ArgumentPack|_.
933 :Returns: the (possibly const-qualified) type of the |tagged reference| in
934 ``A`` having |keyword tag type| ``K``, if any. If no such
935 |tagged reference| exists, returns
936 |boost_result_of|_\ ``<F()>::type``. [#no_result_of]_
938 .. |are_tagged_arguments| replace:: ``are_tagged_arguments``
939 .. _are_tagged_arguments:
941 ``are_tagged_arguments``
942 ------------------------
944 :Defined in: |are_tagged_arguments_header|_
948 template <typename T0, typename ...Pack>
949 struct are_tagged_arguments
950 // : |mpl_true|_\ if T0 and all elements in Pack are
951 // tagged reference types, |mpl_false|_\ otherwise.
956 ``mpl::true_`` if ``T0`` and all elements in parameter pack ``Pack`` are
957 |tagged reference| types, ``mpl::false_`` otherwise.
961 When implementing a Boost.Parameter-enabled constructor for a container that
962 conforms to the C++ standard, one needs to remember that the standard requires
963 the presence of other constructors that are typically defined as templates,
964 such as range constructors. To avoid overload ambiguities between the two
965 constructors, use this metafunction in conjunction with ``disable_if`` to
966 define the range constructor.
970 template <typename B>
971 class frontend : public B
978 |BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR|_\(frontend, (B))
980 template <typename Iterator>
984 , typename |boost_disable_if|_\<
985 are_tagged_arguments<Iterator>
993 .. |is_argument_pack| replace:: ``is_argument_pack``
994 .. _is_argument_pack:
999 :Defined in: |is_argument_pack_header|_
1003 template <typename T>
1004 struct is_argument_pack
1005 // : |mpl_true|_\ if T is a model of |ArgumentPack|_\,
1006 // |mpl_false|_\ otherwise.
1011 ``mpl::true_`` if ``T`` is a model of |ArgumentPack|_, ``mpl::false_``
1016 To avoid overload ambiguities between a constructor that takes in an
1017 |ArgumentPack|_ and a templated conversion constructor, use this
1018 metafunction in conjunction with ``enable_if``.
1022 |BOOST_PARAMETER_NAME|_\(a0)
1024 template <typename T>
1034 template <typename ArgPack>
1037 , typename |boost_enable_if|_\<
1038 is_argument_pack<ArgPack>
1040 >::type = _enabler()
1045 template <typename U>
1047 backend0<U> const& copy
1048 , typename |boost_enable_if|_\<
1049 |boost_is_convertible|_\<U,T>
1051 >::type = _enabler()
1052 ) : a0(copy.get_a0())
1056 T const& get_a0() const
1062 .. |result_of_compose| replace:: ``result_of::compose``
1063 .. _result_of_compose:
1065 ``result_of::compose``
1066 ----------------------
1068 Returns the result type of the |compose|_ function.
1070 :Defined in: |compose_header|_
1074 template <typename ...TaggedArgs>
1076 : |boost_enable_if|_\<
1077 |are_tagged_arguments|_\<T0,Pack...>
1086 typedef *empty* |ArgumentPack|_ type;
1089 :Requires: All elements in ``TaggedArgs`` must be |tagged reference| types, if
1092 :Returns: the result type of the |compose|_ function.
1094 //////////////////////////////////////////////////////////////////////////////
1099 .. |compose| replace:: ``compose``
1105 :Defined in: |compose_header|_
1109 template <typename ...Pack>
1110 constexpr typename |result_of_compose|_\<Pack...>::type
1111 compose(Pack const&... args);
1113 This function facilitates easier variadic argument composition. It is used by
1114 the |BOOST_PARAMETER_NO_SPEC_FUNCTION|_,
1115 |BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION|_,
1116 |BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION|_,
1117 |BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR|_,
1118 |BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR|_,
1119 |BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR|_, and
1120 |BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR|_ code generation macros. You
1121 can use it to write your own code generation macros if the ones provided by
1122 this library do not suffice.
1124 Unlike the |tagged reference| comma operator, the ``compose()`` function is
1125 variadic, as mentioned before. However, the |tagged reference| comma operator
1126 can be invoked indefinitely and therefore does not limit the size of the
1127 resulting |ArgumentPack|, while the ``compose()`` function cannot take in more
1128 than |BOOST_PARAMETER_COMPOSE_MAX_ARITY|_ arguments for compilers that do not
1129 support perfect forwarding.
1131 :Requires: All elements in ``args`` must be |tagged reference| objects, if
1134 :Returns: an |ArgumentPack|_ containing all elements in ``args``, if
1135 specified; an empty |ArgumentPack|_ otherwise.
1141 BOOST_PARAMETER_NAME(index)
1142 BOOST_PARAMETER_NAME(name)
1144 template <typename ArgumentPack>
1145 int print_name_and_index(ArgumentPack const& args)
1147 std::cout << "index = " << args[_index];
1148 std::cout << "name = " << args[_name];
1149 std::cout << "; " << std::endl;
1153 int y = print_name_and_index(compose(_index = 3, _name = "jones"));
1155 The |compose_cpp|_ test program shows more examples using this function.
1157 //////////////////////////////////////////////////////////////////////////////
1159 Code Generation Macros
1160 ======================
1162 Macros in this section can be used to ease the writing of code
1163 using the Parameter library by eliminating repetitive boilerplate.
1165 .. |BOOST_PARAMETER_FUNCTION| replace:: ``BOOST_PARAMETER_FUNCTION``
1166 .. _BOOST_PARAMETER_FUNCTION:
1168 ``BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, arguments)``
1169 --------------------------------------------------------------------
1171 :Defined in: |preprocessor_header|_
1173 Generates a function that can take in positional arguments, composed
1174 arguments, named arguments, and deduced arguments.
1178 The return type of each of the following function templates falls under a
1179 different value category.
1183 template <std::size_t N>
1184 |std_bitset|_\<N + 1> rvalue_bitset()
1186 return |std_bitset|_\<N + 1>();
1189 template <std::size_t N>
1190 |std_bitset|_\<N + 1> const rvalue_const_bitset()
1192 return |std_bitset|_\<N + 1>();
1195 template <std::size_t N>
1196 |std_bitset|_\<N + 1>& lvalue_bitset()
1198 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
1202 template <std::size_t N>
1203 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
1205 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
1209 The ``U::evaluate_category`` static member function template has a simple job:
1210 to return the correct value category when passed in an object returned by one
1211 of the functions defined above. Assume that
1212 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
1218 passed_by_lvalue_reference_to_const
1219 , passed_by_lvalue_reference
1220 , passed_by_rvalue_reference_to_const
1221 , passed_by_rvalue_reference
1226 template <std::size_t N>
1227 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
1229 return passed_by_lvalue_reference_to_const;
1232 template <std::size_t N>
1233 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
1235 return passed_by_lvalue_reference;
1238 template <std::size_t N>
1239 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
1241 return passed_by_rvalue_reference_to_const;
1244 template <std::size_t N>
1245 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
1247 return passed_by_rvalue_reference;
1251 Define the named parameters that will comprise the argument specification that
1252 this macro will use. Ensure that all their tag types are in the same
1253 namespace, which is ``kw`` in this case. The identifiers with leading
1254 underscores can be passed to the bracket operator of ``args`` to extract the
1255 same argument to which the corresponding named parameter (without underscores)
1256 is bound, as will be shown later.
1260 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
1261 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
1262 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
1263 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
1265 Use the macro as a substitute for a normal function header. Enclose the
1266 return type ``bool`` in parentheses. For each parameter, also enclose the
1267 expected value type in parentheses. Since the value types are mutually
1268 exclusive, you can wrap the parameters in a ``(deduced …)``
1269 clause. Otherwise, just as with a normal function, the order in which you
1270 specify the parameters determines their position. Also, just as with a normal
1271 function, optional parameters have default values, whereas required parameters
1272 do not. Within the function body, either simply use the parameter name or
1273 pass the matching identifier with the leading underscore to the bracket
1274 operator of ``args`` to extract the corresponding argument. Note that the
1275 second method doesn't require ``std::forward`` to preserve value categories.
1279 BOOST_PARAMETER_FUNCTION((bool), evaluate, kw,
1282 (lrc, (|std_bitset|_\<1>))
1283 (lr, (|std_bitset|_\<2>))
1286 (rrc, (|std_bitset|_\<3>), rvalue_const_bitset<2>())
1287 (rr, (|std_bitset|_\<4>), rvalue_bitset<3>())
1293 passed_by_lvalue_reference_to_const
1294 , U::evaluate_category<0>(lrc)
1297 passed_by_lvalue_reference
1298 , U::evaluate_category<1>(lr)
1301 passed_by_rvalue_reference_to_const
1302 , U::evaluate_category<2>(|std_forward|_\<rrc0_type>(rrc0))
1305 passed_by_rvalue_reference
1306 , U::evaluate_category<3>(args[_rr0])
1312 The following function calls are legal.
1316 evaluate( // positional arguments
1317 lvalue_const_bitset<0>()
1318 , lvalue_bitset<1>()
1319 , rvalue_const_bitset<2>()
1320 , rvalue_bitset<3>()
1322 evaluate( // positional arguments
1323 lvalue_const_bitset<0>()
1324 , lvalue_bitset<1>()
1326 evaluate(( // composed arguments
1327 _rr0 = rvalue_bitset<3>()
1328 , _lrc0 = lvalue_const_bitset<0>()
1329 , _lr0 = lvalue_bitset<1>()
1330 , _rrc0 = rvalue_const_bitset<2>()
1332 evaluate( // named arguments
1333 _rr0 = rvalue_bitset<3>()
1334 , _lrc0 = lvalue_const_bitset<0>()
1335 , _lr0 = lvalue_bitset<1>()
1336 , _rrc0 = rvalue_const_bitset<2>()
1338 evaluate( // named arguments
1339 _lr0 = lvalue_bitset<1>()
1340 , _lrc0 = lvalue_const_bitset<0>()
1343 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
1344 function calls are also legal.
1348 evaluate( // deduced arguments
1350 , lvalue_const_bitset<0>()
1351 , lvalue_bitset<1>()
1352 , rvalue_const_bitset<2>()
1354 evaluate( // deduced arguments
1356 , lvalue_const_bitset<0>()
1359 The |preprocessor_cpp|_, |preprocessor_deduced_cpp|_, and
1360 |preprocessor_eval_cat_cpp|_ test programs demonstrate proper usage of this
1363 **Macro parameters:**
1365 * ``result`` is the parenthesized return type of the function.
1366 * ``name`` is the base name of the function; it determines the name of the
1367 generated forwarding functions.
1368 * ``tag_namespace`` is the namespace in which the keywords used by the
1370 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
1371 *argument-specifiers*, as defined below.
1373 **Argument specifiers syntax:**
1377 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
1379 specifier-group0 ::= *specifier-group1* |
1381 '**(**' '**deduced**'
1382 *specifier-group1* {*specifier-group1*\ }
1386 specifier-group1 ::=
1388 '**(**' '**optional**'
1389 *optional-specifier* {*optional-specifier*\ }
1392 '**(**' '**required**'
1393 *required-specifier* {*required-specifier*\ }
1397 optional-specifier ::=
1399 *argument-name* '**,**' *restriction* '**,**' *default-value*
1402 required-specifier ::=
1403 '**(**' *argument-name* '**,**' *restriction* ')'
1406 ( '**\***' '**(**' *mfc* '**)**' ) |
1407 ( '**(**' *type-name* '**)**' ) |
1410 * ``argument-name`` is any valid C++ identifier.
1411 * ``default-value`` is any valid C++ expression; if necessary, user code can
1412 compute it in terms of ``previous-name ## _type``, where ``previous-name``
1413 is the ``argument-name`` in a previous ``specifier-group0`` or
1414 ``specifier-group1``. *This expression will be invoked exactly once.*
1415 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
1416 be the type of the corresponding ``argument-name``, whose second argument
1417 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
1418 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
1419 of ``previous-name ## _type``.
1420 * ``type-name`` is either the name of a **target type** or an `MPL Binary
1421 Metafunction Class`_ whose first argument will be the type of the
1422 corresponding ``argument-name``, whose second argument will be the entire
1423 |ArgumentPack|_, and whose return type is the **target type**. If
1424 ``restriction`` uses this form, then the type of the generated name
1425 ``argument-name ## _type`` will be computed in terms of the **target
1426 type**, and the generated reference ``argument-name`` (but not its
1427 corresponding entry in ``args``) will be cast to that type.
1429 **Approximate expansion:**
1433 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
1434 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
1438 // If **result** is a template instantiation of |boost_enable_if|_\,
1439 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
1440 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
1441 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
1442 // |std_enable_if|_\:
1443 template <typename Args>
1444 using boost_param_result\_ ## __LINE__ ## **name** = **result**;
1446 // If **result** is a simple return type:
1447 template <typename Args>
1448 struct boost_param_result\_ ## __LINE__ ## **name**
1450 typedef **result** type;
1453 struct boost_param_params\_ ## __LINE__ ## **name**
1455 *list of parameter specifications, based on arguments*
1460 typedef boost_param_params\_ ## __LINE__ ## **name**
1461 boost_param_parameters\_ ## __LINE__ ## **name**;
1463 template <typename Args>
1464 typename boost_param_result\_ ## __LINE__ ## **name**\ <Args>::type
1465 boost_param_impl ## __LINE__ ## **name**\ (Args const&);
1467 template <typename A0, …, typename A ## **n**>
1468 **result** **name**\ (
1469 A0&& a0, …, A ## **n**\ && a ## **n**
1470 , typename boost_param_parameters\_ ## __LINE__ ## **name**
1471 ::match<A0, …, A ## **n**>::type
1472 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
1475 return boost_param_impl ## __LINE__ ## **name**\ (
1476 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
1477 |std_forward|_\<A0>(a0)
1479 , |std_forward|_\<A ## **n**>(a ## **n**)
1486 template <typename A0, …, typename A ## **m**>
1487 **result** **name**\ (
1488 A0&& a0, …, A ## **m**\ && a ## **m**
1489 , typename boost_param_parameters\_ ## __LINE__ ## **name**
1490 ::match<A0, …, A ## **m**>::type
1491 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
1494 return boost_param_impl ## __LINE__ ## **name**\ (
1495 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
1496 |std_forward|_\<A0>(a0)
1498 , |std_forward|_\<A ## **m**>(a ## **m**)
1506 , typename *argument name* ## **0** ## _type
1508 , typename *argument name* ## **n** ## _type
1511 boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1514 , *argument name* ## **0** ## _type&& *argument name* ## **0**
1516 , *argument name* ## **n** ## _type&& *argument name* ## **m**
1524 , typename *argument name* ## **0** ## _type
1526 , typename *argument name* ## **m** ## _type
1529 boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1532 , *argument name* ## **0** ## _type&& *argument name* ## **0**
1534 , *argument name* ## **m** ## _type&& *argument name* ## **m**
1537 template <typename Args>
1538 typename boost_param_result\_ ## __LINE__ ## **name**\ <Args>::type
1539 boost_param_impl ## __LINE__ ## **name**\ (Args const& args)
1541 return boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1543 typename boost_param_result\_ ## __LINE__ ## **name**\ <
1549 typename |value_type|_\<
1551 , *keyword tag type of required parameter* ## **0**
1553 >(args[ *keyword object of required parameter* ## **0**])
1556 typename |value_type|_\<
1558 , *keyword tag type of required parameter* ## **n**
1560 >(args[ *keyword object of required parameter* ## **n**])
1567 , typename *argument name* ## **0** ## _type
1569 , typename *argument name* ## **n** ## _type
1572 boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1575 , *argument name* ## **0** ## _type&& *argument name* ## **0**
1577 , *argument name* ## **n** ## _type&& *argument name* ## **n**
1580 return boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1581 static_cast<ResultType(*)()>(|std_nullptr|_\)
1582 , (args, *keyword object of optional parameter* ## **n + 1** =
1583 *default value of optional parameter* ## **n + 1**
1585 , |std_forward|_\<*argument name* ## **0** ## _type>(
1586 *argument name* ## **0**
1589 , |std_forward|_\<*argument name* ## **n** ## _type>(
1590 *argument name* ## **n**
1593 typename |value_type|_\<
1595 , *keyword tag type of optional parameter* ## **n + 1**
1597 >(*default value of optional parameter* ## **n + 1**)
1606 , typename *argument name* ## **0** ## _type
1608 , typename *argument name* ## **m** ## _type
1611 boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1614 , *argument name* ## **0** ## _type&& *argument name* ## **0**
1616 , *argument name* ## **m** ## _type&& *argument name* ## **m**
1619 .. |BOOST_PARAMETER_MEMBER_FUNCTION| replace:: ``BOOST_PARAMETER_MEMBER_FUNCTION``
1620 .. _BOOST_PARAMETER_MEMBER_FUNCTION:
1622 ``BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, arguments)``
1623 ---------------------------------------------------------------------------
1625 :Defined in: |preprocessor_header|_
1627 Generates a member function that can take in positional arguments, composed
1628 arguments, named arguments, and deduced arguments.
1632 The return type of each of the following function templates falls under a
1633 different value category.
1637 template <std::size_t N>
1638 |std_bitset|_\<N + 1> rvalue_bitset()
1640 return |std_bitset|_\<N + 1>();
1643 template <std::size_t N>
1644 |std_bitset|_\<N + 1> const rvalue_const_bitset()
1646 return |std_bitset|_\<N + 1>();
1649 template <std::size_t N>
1650 |std_bitset|_\<N + 1>& lvalue_bitset()
1652 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
1656 template <std::size_t N>
1657 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
1659 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
1663 The ``U::evaluate_category`` static member function template has a simple job:
1664 to return the correct value category when passed in an object returned by one
1665 of the functions defined above. Assume that
1666 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
1672 passed_by_lvalue_reference_to_const
1673 , passed_by_lvalue_reference
1674 , passed_by_rvalue_reference_to_const
1675 , passed_by_rvalue_reference
1680 template <std::size_t N>
1681 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
1683 return passed_by_lvalue_reference_to_const;
1686 template <std::size_t N>
1687 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
1689 return passed_by_lvalue_reference;
1692 template <std::size_t N>
1693 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
1695 return passed_by_rvalue_reference_to_const;
1698 template <std::size_t N>
1699 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
1701 return passed_by_rvalue_reference;
1705 Define the named parameters that will comprise the argument specification that
1706 this macro will use. Ensure that all their tag types are in the same
1707 namespace, which is ``kw`` in this case. The identifiers with leading
1708 underscores can be passed to the bracket operator of ``args`` to extract the
1709 same argument to which the corresponding named parameter (without underscores)
1710 is bound, as will be shown later.
1714 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
1715 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
1716 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
1717 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
1719 Use the macro as a substitute for a normal ``static`` member function
1720 header. Enclose the return type ``bool`` in parentheses. For each parameter,
1721 also enclose the expected value type in parentheses. Since the value types
1722 are mutually exclusive, you can wrap the parameters in a ``(deduced …)``
1723 clause. Otherwise, just as with a normal function, the order in which you
1724 specify the parameters determines their position. Also, just as with a normal
1725 function, optional parameters have default values, whereas required parameters
1726 do not. Within the function body, either simply use the parameter name or
1727 pass the matching identifier with the leading underscore to the bracket
1728 operator of ``args`` to extract the corresponding argument. Note that the
1729 second method doesn't require ``std::forward`` to preserve value categories.
1735 BOOST_PARAMETER_MEMBER_FUNCTION((bool), static evaluate, kw,
1738 (lrc, (|std_bitset|_\<1>))
1739 (lr, (|std_bitset|_\<2>))
1742 (rrc, (|std_bitset|_\<3>), rvalue_const_bitset<2>())
1743 (rr, (|std_bitset|_\<4>), rvalue_bitset<3>())
1749 passed_by_lvalue_reference_to_const
1750 , U::evaluate_category<0>(lrc)
1753 passed_by_lvalue_reference
1754 , U::evaluate_category<1>(lr)
1757 passed_by_rvalue_reference_to_const
1758 , U::evaluate_category<2>(|std_forward|_\<rrc0_type>(rrc0))
1761 passed_by_rvalue_reference
1762 , U::evaluate_category<3>(args[_rr0])
1769 The following function calls are legal.
1773 B::evaluate( // positional arguments
1774 lvalue_const_bitset<0>()
1775 , lvalue_bitset<1>()
1776 , rvalue_const_bitset<2>()
1777 , rvalue_bitset<3>()
1779 B::evaluate( // positional arguments
1780 lvalue_const_bitset<0>()
1781 , lvalue_bitset<1>()
1783 B::evaluate(( // composed arguments
1784 _rr0 = rvalue_bitset<3>()
1785 , _lrc0 = lvalue_const_bitset<0>()
1786 , _lr0 = lvalue_bitset<1>()
1787 , _rrc0 = rvalue_const_bitset<2>()
1789 B::evaluate( // named arguments
1790 _rr0 = rvalue_bitset<3>()
1791 , _lrc0 = lvalue_const_bitset<0>()
1792 , _lr0 = lvalue_bitset<1>()
1793 , _rrc0 = rvalue_const_bitset<2>()
1795 B::evaluate( // named arguments
1796 _lr0 = lvalue_bitset<1>()
1797 , _lrc0 = lvalue_const_bitset<0>()
1800 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
1801 function calls are also legal.
1805 B::evaluate( // deduced arguments
1807 , lvalue_const_bitset<0>()
1808 , lvalue_bitset<1>()
1809 , rvalue_const_bitset<2>()
1811 B::evaluate( // deduced arguments
1813 , lvalue_const_bitset<0>()
1816 The |preprocessor_cpp|_ and |preprocessor_eval_cat_cpp|_ test programs
1817 demonstrate proper usage of this macro.
1819 **Macro parameters:**
1821 * ``result`` is the parenthesized return type of the function.
1822 * ``name`` is the base name of the function; it determines the name of the
1823 generated forwarding functions. ``name`` may be qualified by the
1824 ``static`` keyword to declare the member function and its helpers as not
1825 associated with any object of the enclosing type.
1826 * ``tag_namespace`` is the namespace in which the keywords used by the
1828 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
1829 *argument-specifiers*, as defined below.
1831 **Argument specifiers syntax:**
1835 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
1837 specifier-group0 ::= *specifier-group1* |
1839 '**(**' '**deduced**'
1840 *specifier-group1* {*specifier-group1*\ }
1844 specifier-group1 ::=
1846 '**(**' '**optional**'
1847 *optional-specifier* {*optional-specifier*\ }
1850 '**(**' '**required**'
1851 *required-specifier* {*required-specifier*\ }
1855 optional-specifier ::=
1857 *argument-name* '**,**' *restriction* '**,**' *default-value*
1860 required-specifier ::=
1861 '**(**' *argument-name* '**,**' *restriction* ')'
1864 ( '**\***' '**(**' *mfc* '**)**' ) |
1865 ( '**(**' *type-name* '**)**' ) |
1868 * ``argument-name`` is any valid C++ identifier.
1869 * ``default-value`` is any valid C++ expression; if necessary, user code can
1870 compute it in terms of ``previous-name ## _type``, where ``previous-name``
1871 is the ``argument-name`` in a previous ``specifier-group0`` or
1872 ``specifier-group1``. *This expression will be invoked exactly once.*
1873 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
1874 be the type of the corresponding ``argument-name``, whose second argument
1875 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
1876 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
1877 of ``previous-name ## _type``.
1878 * ``type-name`` is either the name of a **target type** or an `MPL Binary
1879 Metafunction Class`_ whose first argument will be the type of the
1880 corresponding ``argument-name``, whose second argument will be the entire
1881 |ArgumentPack|_, and whose return type is the **target type**. If
1882 ``restriction`` uses this form, then the type of the generated name
1883 ``argument-name ## _type`` will be computed in terms of the **target
1884 type**, and the generated reference ``argument-name`` (but not its
1885 corresponding entry in ``args``) will be cast to that type.
1887 **Approximate expansion:**
1891 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
1892 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
1896 // If **result** is a template instantiation of |boost_enable_if|_\,
1897 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
1898 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
1899 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
1900 // |std_enable_if|_\:
1901 template <typename Args>
1902 using boost_param_result\_ ## __LINE__ ## **name** = **result**;
1904 // If **result** is a simple return type:
1905 template <typename Args>
1906 struct boost_param_result\_ ## __LINE__ ## **name**
1908 typedef **result** type;
1911 struct boost_param_params\_ ## __LINE__ ## **name**
1913 *list of parameter specifications, based on arguments*
1918 typedef boost_param_params\_ ## __LINE__ ## **name**
1919 boost_param_parameters\_ ## __LINE__ ## **name**;
1921 template <typename A0, …, typename A ## **n**>
1922 **result** **name**\ (
1923 A0&& a0, …, A ## **n**\ && a ## **n**
1924 , typename boost_param_parameters\_ ## __LINE__ ## **name**
1925 ::match<A0, …, A ## **n**>::type
1926 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
1929 return this->boost_param_impl ## __LINE__ ## **name**\ (
1930 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
1931 |std_forward|_\<A0>(a0)
1933 , |std_forward|_\<A ## **n**>(a ## **n**)
1940 template <typename A0, …, typename A ## **m**>
1941 **result** **name**\ (
1942 A0&& a0, …, A ## **m**\ && a ## **m**
1943 , typename boost_param_parameters\_ ## __LINE__ ## **name**
1944 ::match<A0, …, A ## **m**>::type
1945 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
1948 return this->boost_param_impl ## __LINE__ ## **name**\ (
1949 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
1950 |std_forward|_\<A0>(a0)
1952 , |std_forward|_\<A ## **m**>(a ## **m**)
1957 template <typename Args>
1958 typename boost_param_result\_ ## __LINE__ ## **name**\ <Args>::type
1959 boost_param_impl ## __LINE__ ## **name**\ (Args const& args)
1961 return this->boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1963 typename boost_param_result\_ ## __LINE__ ## **name**\ <
1969 typename |value_type|_\<
1971 , *keyword tag type of required parameter* ## **0**
1973 >(args[ *keyword object of required parameter* ## **0**])
1976 typename |value_type|_\<
1978 , *keyword tag type of required parameter* ## **n**
1980 >(args[ *keyword object of required parameter* ## **n**])
1987 , typename *argument name* ## **0** ## _type
1989 , typename *argument name* ## **n** ## _type
1992 boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
1995 , *argument name* ## **0** ## _type&& *argument name* ## **0**
1997 , *argument name* ## **n** ## _type&& *argument name* ## **n**
2000 return this->boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
2001 static_cast<ResultType(*)()>(|std_nullptr|_\)
2002 , (args, *keyword object of optional parameter* ## **n + 1** =
2003 *default value of optional parameter* ## **n + 1**
2005 , |std_forward|_\<*argument name* ## **0** ## _type>(
2006 *argument name* ## **0**
2009 , |std_forward|_\<*argument name* ## **n** ## _type>(
2010 *argument name* ## **n**
2013 typename |value_type|_\<
2015 , *keyword tag type of optional parameter* ## **n + 1**
2017 >(*default value of optional parameter* ## **n + 1**)
2026 , typename *argument name* ## **0** ## _type
2028 , typename *argument name* ## **m** ## _type
2031 boost_param_dispatch_0boost\_ ## __LINE__ ## **name**\ (
2034 , *argument name* ## **0** ## _type&& *argument name* ## **0**
2036 , *argument name* ## **m** ## _type&& *argument name* ## **m**
2039 .. |BOOST_PARAMETER_CONST_MEMBER_FUNCTION| replace:: ``BOOST_PARAMETER_CONST_MEMBER_FUNCTION``
2040 .. _BOOST_PARAMETER_CONST_MEMBER_FUNCTION:
2042 ``BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_ns, arguments)``
2043 --------------------------------------------------------------------------
2045 :Defined in: |preprocessor_header|_
2047 Generates a member function that can take in positional arguments, composed
2048 arguments, named arguments, and deduced arguments.
2052 The return type of each of the following function templates falls under a
2053 different value category.
2057 template <std::size_t N>
2058 |std_bitset|_\<N + 1> rvalue_bitset()
2060 return |std_bitset|_\<N + 1>();
2063 template <std::size_t N>
2064 |std_bitset|_\<N + 1> const rvalue_const_bitset()
2066 return |std_bitset|_\<N + 1>();
2069 template <std::size_t N>
2070 |std_bitset|_\<N + 1>& lvalue_bitset()
2072 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
2076 template <std::size_t N>
2077 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
2079 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
2083 The ``U::evaluate_category`` static member function template has a simple job:
2084 to return the correct value category when passed in an object returned by one
2085 of the functions defined above. Assume that
2086 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
2092 passed_by_lvalue_reference_to_const
2093 , passed_by_lvalue_reference
2094 , passed_by_rvalue_reference_to_const
2095 , passed_by_rvalue_reference
2100 template <std::size_t N>
2101 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
2103 return passed_by_lvalue_reference_to_const;
2106 template <std::size_t N>
2107 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
2109 return passed_by_lvalue_reference;
2112 template <std::size_t N>
2113 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
2115 return passed_by_rvalue_reference_to_const;
2118 template <std::size_t N>
2119 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
2121 return passed_by_rvalue_reference;
2125 Define the named parameters that will comprise the argument specification that
2126 this macro will use. Ensure that all their tag types are in the same
2127 namespace, which is ``kw`` in this case. The identifiers with leading
2128 underscores can be passed to the bracket operator of ``args`` to extract the
2129 same argument to which the corresponding named parameter (without underscores)
2130 is bound, as will be shown later.
2134 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
2135 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
2136 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
2137 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
2139 Use the macro as a substitute for a normal ``const`` member function
2140 header. Enclose the return type ``bool`` in parentheses. For each parameter,
2141 also enclose the expected value type in parentheses. Since the value types
2142 are mutually exclusive, you can wrap the parameters in a ``(deduced …)``
2143 clause. Otherwise, just as with a normal function, the order in which you
2144 specify the parameters determines their position. Also, just as with a normal
2145 function, optional parameters have default values, whereas required parameters
2146 do not. Within the function body, either simply use the parameter name or
2147 pass the matching identifier with the leading underscore to the bracket
2148 operator of ``args`` to extract the corresponding argument. Note that the
2149 second method doesn't require ``std::forward`` to preserve value categories.
2159 BOOST_PARAMETER_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
2162 (lrc, (|std_bitset|_\<1>))
2163 (lr, (|std_bitset|_\<2>))
2166 (rrc, (|std_bitset|_\<3>), rvalue_const_bitset<2>())
2167 (rr, (|std_bitset|_\<4>), rvalue_bitset<3>())
2173 passed_by_lvalue_reference_to_const
2174 , U::evaluate_category<0>(lrc)
2177 passed_by_lvalue_reference
2178 , U::evaluate_category<1>(lr)
2181 passed_by_rvalue_reference_to_const
2182 , U::evaluate_category<2>(|std_forward|_\<rrc0_type>(rrc0))
2185 passed_by_rvalue_reference
2186 , U::evaluate_category<3>(args[_rr0])
2193 The following function calls are legal.
2198 b.evaluate( // positional arguments
2199 lvalue_const_bitset<0>()
2200 , lvalue_bitset<1>()
2201 , rvalue_const_bitset<2>()
2202 , rvalue_bitset<3>()
2204 b.evaluate( // positional arguments
2205 lvalue_const_bitset<0>()
2206 , lvalue_bitset<1>()
2208 b.evaluate(( // composed arguments
2209 _rr0 = rvalue_bitset<3>()
2210 , _lrc0 = lvalue_const_bitset<0>()
2211 , _lr0 = lvalue_bitset<1>()
2212 , _rrc0 = rvalue_const_bitset<2>()
2214 b.evaluate( // named arguments
2215 _rr0 = rvalue_bitset<3>()
2216 , _lrc0 = lvalue_const_bitset<0>()
2217 , _lr0 = lvalue_bitset<1>()
2218 , _rrc0 = rvalue_const_bitset<2>()
2220 b.evaluate( // named arguments
2221 _lr0 = lvalue_bitset<1>()
2222 , _lrc0 = lvalue_const_bitset<0>()
2225 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
2226 function calls are also legal.
2230 b.evaluate( // deduced arguments
2232 , lvalue_const_bitset<0>()
2233 , lvalue_bitset<1>()
2234 , rvalue_const_bitset<2>()
2236 b.evaluate( // deduced arguments
2238 , lvalue_const_bitset<0>()
2241 The |preprocessor_cpp|_ test program demonstrates proper usage of this macro.
2243 **Macro parameters:**
2245 * ``result`` is the parenthesized return type of the function.
2246 * ``name`` is the base name of the function; it determines the name of the
2247 generated forwarding functions.
2248 * ``tag_namespace`` is the namespace in which the keywords used by the
2250 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
2251 *argument-specifiers*, as defined below.
2253 **Argument specifiers syntax:**
2257 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
2259 specifier-group0 ::= *specifier-group1* |
2261 '**(**' '**deduced**'
2262 *specifier-group1* {*specifier-group1*\ }
2266 specifier-group1 ::=
2268 '**(**' '**optional**'
2269 *optional-specifier* {*optional-specifier*\ }
2272 '**(**' '**required**'
2273 *required-specifier* {*required-specifier*\ }
2277 optional-specifier ::=
2279 *argument-name* '**,**' *restriction* '**,**' *default-value*
2282 required-specifier ::=
2283 '**(**' *argument-name* '**,**' *restriction* ')'
2286 ( '**\***' '**(**' *mfc* '**)**' ) |
2287 ( '**(**' *type-name* '**)**' ) |
2290 * ``argument-name`` is any valid C++ identifier.
2291 * ``default-value`` is any valid C++ expression; if necessary, user code can
2292 compute it in terms of ``previous-name ## _type``, where ``previous-name``
2293 is the ``argument-name`` in a previous ``specifier-group0`` or
2294 ``specifier-group1``. *This expression will be invoked exactly once.*
2295 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
2296 be the type of the corresponding ``argument-name``, whose second argument
2297 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
2298 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
2299 of ``previous-name ## _type``.
2300 * ``type-name`` is either the name of a **target type** or an `MPL Binary
2301 Metafunction Class`_ whose first argument will be the type of the
2302 corresponding ``argument-name``, whose second argument will be the entire
2303 |ArgumentPack|_, and whose return type is the **target type**. If
2304 ``restriction`` uses this form, then the type of the generated name
2305 ``argument-name ## _type`` will be computed in terms of the **target
2306 type**, and the generated reference ``argument-name`` (but not its
2307 corresponding entry in ``args``) will be cast to that type.
2309 **Approximate expansion:**
2313 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
2314 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
2318 // If **result** is a template instantiation of |boost_enable_if|_\,
2319 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
2320 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
2321 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
2322 // |std_enable_if|_\:
2323 template <typename Args>
2324 using boost_param_result_const\_ ## __LINE__ ## **name** = **result**;
2326 // If **result** is a simple return type:
2327 template <typename Args>
2328 struct boost_param_result_const\_ ## __LINE__ ## **name**
2330 typedef **result** type;
2333 struct boost_param_params_const\_ ## __LINE__ ## **name**
2335 *list of parameter specifications, based on arguments*
2340 typedef boost_param_params_const\_ ## __LINE__ ## **name**
2341 boost_param_parameters_const\_ ## __LINE__ ## **name**;
2343 template <typename A0, …, typename A ## **n**>
2344 **result** **name**\ (
2345 A0&& a0, …, A ## **n**\ && a ## **n**
2346 , typename boost_param_parameters_const\_ ## __LINE__ ## **name**
2347 ::match<A0, …, A ## **n**>::type
2348 = boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()
2351 return this->boost_param_impl_const ## __LINE__ ## **name**\ (
2352 boost_param_parameters_const\_ ## __LINE__ ## **name**\ (
2353 |std_forward|_\<A0>(a0)
2355 , |std_forward|_\<A ## **n**>(a ## **n**)
2362 template <typename A0, …, typename A ## **m**>
2363 **result** **name**\ (
2364 A0&& a0, …, A ## **m**\ && a ## **m**
2365 , typename boost_param_parameters_const\_ ## __LINE__ ## **name**
2366 ::match<A0, …, A ## **m**>::type
2367 = boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()
2370 return this->boost_param_impl_const ## __LINE__ ## **name**\ (
2371 boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()(
2372 |std_forward|_\<A0>(a0)
2374 , |std_forward|_\<A ## **m**>(a ## **m**)
2379 template <typename Args>
2380 typename boost_param_result_const\_ ## __LINE__ ## **name**\ <Args>::type
2381 boost_param_impl_const ## __LINE__ ## **name**\ (Args const& args) const
2384 boost_param_dispatch_const_0boost\_ ## __LINE__ ## **name**\ (
2386 typename boost_param_result_const\_ ## __LINE__ ## **name**\ <
2392 typename |value_type|_\<
2394 , *keyword tag type of required parameter* ## **0**
2396 >(args[ *keyword object of required parameter* ## **0**])
2399 typename |value_type|_\<
2401 , *keyword tag type of required parameter* ## **n**
2403 >(args[ *keyword object of required parameter* ## **n**])
2410 , typename *argument name* ## **0** ## _type
2412 , typename *argument name* ## **n** ## _type
2415 boost_param_dispatch_const_0boost\_ ## __LINE__ ## **name**\ (
2418 , *argument name* ## **0** ## _type&& *argument name* ## **0**
2420 , *argument name* ## **n** ## _type&& *argument name* ## **n**
2424 boost_param_dispatch_const_0boost\_ ## __LINE__ ## **name**\ (
2425 static_cast<ResultType(*)()>(|std_nullptr|_\)
2426 , (args, *keyword object of optional parameter* ## **n + 1** =
2427 *default value of optional parameter* ## **n + 1**
2429 , |std_forward|_\<*argument name* ## **0** ## _type>(
2430 *argument name* ## **0**
2433 , |std_forward|_\<*argument name* ## **n** ## _type>(
2434 *argument name* ## **n**
2437 typename |value_type|_\<
2439 , *keyword tag type of optional parameter* ## **n + 1**
2441 >(*default value of optional parameter* ## **n + 1**)
2450 , typename *argument name* ## **0** ## _type
2452 , typename *argument name* ## **m** ## _type
2455 boost_param_dispatch_const_0boost\_ ## __LINE__ ## **name**\ (
2458 , *argument name* ## **0** ## _type&& *argument name* ## **0**
2460 , *argument name* ## **m** ## _type&& *argument name* ## **m**
2463 .. |BOOST_PARAMETER_FUNCTION_CALL_OPERATOR| replace:: ``BOOST_PARAMETER_FUNCTION_CALL_OPERATOR``
2464 .. _BOOST_PARAMETER_FUNCTION_CALL_OPERATOR:
2466 ``BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, tag_namespace, arguments)``
2467 ----------------------------------------------------------------------------
2469 :Defined in: |preprocessor_header|_
2471 Generates a function call operator that can take in positional arguments,
2472 composed arguments, named arguments, and deduced arguments.
2476 Define the named parameters that will comprise the argument specification that
2477 this macro will use. Ensure that all their tag types are in the same
2478 namespace, which is ``tag`` by default.
2482 |BOOST_PARAMETER_NAME|_\(y)
2483 |BOOST_PARAMETER_NAME|_\(z)
2485 Use the macro as a substitute for a normal function call operator
2486 header. Enclose the return type in parentheses. For each parameter, also
2487 enclose the expected value type in parentheses. Since the value types are
2488 mutually exclusive, you can wrap the parameters in a ``(deduced …)``
2489 clause. This is especially useful when implementing multiple
2490 Boost.Parameter-enabled function call operator overloads.
2500 explicit char_reader(char const* k) : index(0), key(k)
2504 BOOST_PARAMETER_FUNCTION_CALL_OPERATOR((void), tag,
2517 |BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR|_\((char), tag,
2521 (z, (|std_map|_\<char const*, |std_string|_\>))
2527 (z.find(this->key)->second)[this->index]
2528 ) : this->key[this->index];
2532 As with regular argument-dependent lookup, the value types of the arguments
2533 passed in determine which function call operator overload gets invoked.
2537 char const* keys[] = {"foo", "bar", "baz"};
2538 |std_map|_\<char const*, |std_string|_\> k2s;
2539 k2s[keys[0]] = |std_string|_\("qux");
2540 k2s[keys[1]] = |std_string|_\("wmb");
2541 k2s[keys[2]] = |std_string|_\("zxc");
2542 char_reader r(keys[0]);
2544 // positional arguments
2545 BOOST_TEST_EQ('q', (r(true, k2s)));
2546 BOOST_TEST_EQ('f', (r(false, k2s)));
2549 r(_z = keys[1], _y = 1);
2550 BOOST_TEST_EQ('m', (r(_z = k2s, _y = true)));
2551 BOOST_TEST_EQ('a', (r(_z = k2s, _y = false)));
2553 // deduced arguments
2555 BOOST_TEST_EQ('c', (r(k2s, true)));
2556 BOOST_TEST_EQ('z', (r(k2s, false)));
2558 The |preprocessor_cpp|_ and |preprocessor_deduced_cpp|_ test programs
2559 demonstrate proper usage of this macro.
2561 **Macro parameters:**
2563 * ``result`` is the parenthesized return type of the function call operator.
2564 * ``tag_namespace`` is the namespace in which the keywords used by the
2565 function call operator resides.
2566 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
2567 *argument-specifiers*, as defined below.
2569 **Argument specifiers syntax:**
2573 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
2575 specifier-group0 ::= *specifier-group1* |
2577 '**(**' '**deduced**'
2578 *specifier-group1* {*specifier-group1*\ }
2582 specifier-group1 ::=
2584 '**(**' '**optional**'
2585 *optional-specifier* {*optional-specifier*\ }
2588 '**(**' '**required**'
2589 *required-specifier* {*required-specifier*\ }
2593 optional-specifier ::=
2595 *argument-name* '**,**' *restriction* '**,**' *default-value*
2598 required-specifier ::=
2599 '**(**' *argument-name* '**,**' *restriction* ')'
2602 ( '**\***' '**(**' *mfc* '**)**' ) |
2603 ( '**(**' *type-name* '**)**' ) |
2606 * ``argument-name`` is any valid C++ identifier.
2607 * ``default-value`` is any valid C++ expression; if necessary, user code can
2608 compute it in terms of ``previous-name ## _type``, where ``previous-name``
2609 is the ``argument-name`` in a previous ``specifier-group0`` or
2610 ``specifier-group1``. *This expression will be invoked exactly once.*
2611 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
2612 be the type of the corresponding ``argument-name``, whose second argument
2613 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
2614 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
2615 of ``previous-name ## _type``.
2616 * ``type-name`` is either the name of a **target type** or an `MPL Binary
2617 Metafunction Class`_ whose first argument will be the type of the
2618 corresponding ``argument-name``, whose second argument will be the entire
2619 |ArgumentPack|_, and whose return type is the **target type**. If
2620 ``restriction`` uses this form, then the type of the generated name
2621 ``argument-name ## _type`` will be computed in terms of the **target
2622 type**, and the generated reference ``argument-name`` (but not its
2623 corresponding entry in ``args``) will be cast to that type.
2625 **Approximate expansion:**
2629 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
2630 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
2634 // If **result** is a template instantiation of |boost_enable_if|_\,
2635 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
2636 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
2637 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
2638 // |std_enable_if|_\:
2639 template <typename Args>
2640 using boost_param_result\_ ## __LINE__ ## operator = **result**;
2642 // If **result** is a simple return type:
2643 template <typename Args>
2644 struct boost_param_result\_ ## __LINE__ ## operator
2646 typedef **result** type;
2649 struct boost_param_params\_ ## __LINE__ ## operator
2651 *list of parameter specifications, based on arguments*
2656 typedef boost_param_params\_ ## __LINE__ ## operator
2657 boost_param_parameters\_ ## __LINE__ ## operator;
2659 template <typename A0, …, typename A ## **n**>
2660 **result** operator()(
2661 A0&& a0, …, A ## **n**\ && a ## **n**
2662 , typename boost_param_parameters\_ ## __LINE__ ## operator::match<
2664 >::type = boost_param_parameters\_ ## __LINE__ ## operator()
2667 return this->boost_param_impl ## __LINE__ ## operator(
2668 boost_param_parameters\_ ## __LINE__ ## operator()(
2669 |std_forward|_\<A0>(a0)
2671 , |std_forward|_\<A ## **n**>(a ## **n**)
2678 template <typename A0, …, typename A ## **m**>
2679 **result** operator()(
2680 A0&& a0, …, A ## **m**\ && a ## **m**
2681 , typename boost_param_parameters\_ ## __LINE__ ## operator::match<
2683 >::type = boost_param_parameters\_ ## __LINE__ ## operator()
2686 return this->boost_param_impl ## __LINE__ ## operator(
2687 boost_param_parameters\_ ## __LINE__ ## operator()(
2688 |std_forward|_\<A0>(a0)
2690 , |std_forward|_\<A ## **m**>(a ## **m**)
2695 template <typename Args>
2696 typename boost_param_result\_ ## __LINE__ ## operator<Args>::type
2697 boost_param_impl ## __LINE__ ## operator(Args const& args)
2699 return this->boost_param_dispatch_0boost\_ ## __LINE__ ## operator(
2701 typename boost_param_result\_ ## __LINE__ ## operator<
2707 typename |value_type|_\<
2709 , *keyword tag type of required parameter* ## **0**
2711 >(args[ *keyword object of required parameter* ## **0**])
2714 typename |value_type|_\<
2716 , *keyword tag type of required parameter* ## **n**
2718 >(args[ *keyword object of required parameter* ## **n**])
2725 , typename *argument name* ## **0** ## _type
2727 , typename *argument name* ## **n** ## _type
2730 boost_param_dispatch_0boost\_ ## __LINE__ ## operator(
2733 , *argument name* ## **0** ## _type&& *argument name* ## **0**
2735 , *argument name* ## **n** ## _type&& *argument name* ## **n**
2738 return this->boost_param_dispatch_0boost\_ ## __LINE__ ## operator(
2739 static_cast<ResultType(*)()>(|std_nullptr|_\)
2740 , (args, *keyword object of optional parameter* ## **n + 1** =
2741 *default value of optional parameter* ## **n + 1**
2743 , |std_forward|_\<*argument name* ## **0** ## _type>(
2744 *argument name* ## **0**
2747 , |std_forward|_\<*argument name* ## **n** ## _type>(
2748 *argument name* ## **n**
2751 typename |value_type|_\<
2753 , *keyword tag type of optional parameter* ## **n + 1**
2755 >(*default value of optional parameter* ## **n + 1**)
2764 , typename *argument name* ## **0** ## _type
2766 , typename *argument name* ## **m** ## _type
2769 boost_param_dispatch_0boost\_ ## __LINE__ ## operator(
2772 , *argument name* ## **0** ## _type&& *argument name* ## **0**
2774 , *argument name* ## **m** ## _type&& *argument name* ## **m**
2777 .. |BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR| replace:: ``BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR``
2778 .. _BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR:
2780 ``BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)``
2781 ---------------------------------------------------------------------------
2783 :Defined in: |preprocessor_header|_
2785 Generates a function call operator that can take in positional arguments,
2786 composed arguments, named arguments, and deduced arguments.
2790 The return type of each of the following function templates falls under a
2791 different value category.
2795 template <std::size_t N>
2796 |std_bitset|_\<N + 1> rvalue_bitset()
2798 return |std_bitset|_\<N + 1>();
2801 template <std::size_t N>
2802 |std_bitset|_\<N + 1> const rvalue_const_bitset()
2804 return |std_bitset|_\<N + 1>();
2807 template <std::size_t N>
2808 |std_bitset|_\<N + 1>& lvalue_bitset()
2810 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
2814 template <std::size_t N>
2815 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
2817 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
2821 The ``U::evaluate_category`` static member function template has a simple job:
2822 to return the correct value category when passed in an object returned by one
2823 of the functions defined above. Assume that
2824 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
2830 passed_by_lvalue_reference_to_const
2831 , passed_by_lvalue_reference
2832 , passed_by_rvalue_reference_to_const
2833 , passed_by_rvalue_reference
2838 template <std::size_t N>
2839 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
2841 return passed_by_lvalue_reference_to_const;
2844 template <std::size_t N>
2845 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
2847 return passed_by_lvalue_reference;
2850 template <std::size_t N>
2851 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
2853 return passed_by_rvalue_reference_to_const;
2856 template <std::size_t N>
2857 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
2859 return passed_by_rvalue_reference;
2863 Define the named parameters that will comprise the argument specification that
2864 this macro will use. Ensure that all their tag types are in the same
2865 namespace, which is ``kw`` in this case. The identifiers with leading
2866 underscores can be passed to the bracket operator of ``args`` to extract the
2867 same argument to which the corresponding named parameter (without underscores)
2868 is bound, as will be shown later.
2872 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
2873 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
2874 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
2875 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
2877 Use the macro as a substitute for a normal ``const`` function call operator
2878 header. Enclose the return type ``bool`` in parentheses. For each parameter,
2879 also enclose the expected value type in parentheses. Since the value types
2880 are mutually exclusive, you can wrap the parameters in a ``(deduced …)``
2881 clause. Otherwise, just as with a normal function, the order in which you
2882 specify the parameters determines their position. Also, just as with a normal
2883 function, optional parameters have default values, whereas required parameters
2884 do not. Within the function body, either simply use the parameter name or
2885 pass the matching identifier with the leading underscore to the bracket
2886 operator of ``args`` to extract the corresponding argument. Note that the
2887 second method doesn't require ``std::forward`` to preserve value categories.
2897 BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
2900 (lrc, (|std_bitset|_\<1>))
2901 (lr, (|std_bitset|_\<2>))
2904 (rrc, (|std_bitset|_\<3>), rvalue_const_bitset<2>())
2905 (rr, (|std_bitset|_\<4>), rvalue_bitset<3>())
2911 passed_by_lvalue_reference_to_const
2912 , U::evaluate_category<0>(lrc)
2915 passed_by_lvalue_reference
2916 , U::evaluate_category<1>(lr)
2919 passed_by_rvalue_reference_to_const
2920 , U::evaluate_category<2>(|std_forward|_\<rrc0_type>(rrc0))
2923 passed_by_rvalue_reference
2924 , U::evaluate_category<3>(args[_rr0])
2931 The following function calls are legal.
2936 b( // positional arguments
2937 lvalue_const_bitset<0>()
2938 , lvalue_bitset<1>()
2939 , rvalue_const_bitset<2>()
2940 , rvalue_bitset<3>()
2942 b( // positional arguments
2943 lvalue_const_bitset<0>()
2944 , lvalue_bitset<1>()
2946 b(( // composed arguments
2947 _rr0 = rvalue_bitset<3>()
2948 , _lrc0 = lvalue_const_bitset<0>()
2949 , _lr0 = lvalue_bitset<1>()
2950 , _rrc0 = rvalue_const_bitset<2>()
2952 b( // named arguments
2953 _rr0 = rvalue_bitset<3>()
2954 , _lrc0 = lvalue_const_bitset<0>()
2955 , _lr0 = lvalue_bitset<1>()
2956 , _rrc0 = rvalue_const_bitset<2>()
2958 b( // named arguments
2959 _lr0 = lvalue_bitset<1>()
2960 , _lrc0 = lvalue_const_bitset<0>()
2963 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
2964 function calls are also legal.
2968 b( // deduced arguments
2970 , lvalue_const_bitset<0>()
2971 , lvalue_bitset<1>()
2972 , rvalue_const_bitset<2>()
2974 b( // deduced arguments
2976 , lvalue_const_bitset<0>()
2979 The |preprocessor_cpp|_, |preprocessor_deduced_cpp|_, and
2980 |preprocessor_eval_cat_8_cpp|_ test programs demonstrate proper usage of this
2983 **Macro parameters:**
2985 * ``result`` is the parenthesized return type of the function call operator.
2986 * ``tag_namespace`` is the namespace in which the keywords used by the
2987 function call operator resides.
2988 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
2989 *argument-specifiers*, as defined below.
2991 **Argument specifiers syntax:**
2995 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
2997 specifier-group0 ::= *specifier-group1* |
2999 '**(**' '**deduced**'
3000 *specifier-group1* {*specifier-group1*\ }
3004 specifier-group1 ::=
3006 '**(**' '**optional**'
3007 *optional-specifier* {*optional-specifier*\ }
3010 '**(**' '**required**'
3011 *required-specifier* {*required-specifier*\ }
3015 optional-specifier ::=
3017 *argument-name* '**,**' *restriction* '**,**' *default-value*
3020 required-specifier ::=
3021 '**(**' *argument-name* '**,**' *restriction* ')'
3024 ( '**\***' '**(**' *mfc* '**)**' ) |
3025 ( '**(**' *type-name* '**)**' ) |
3028 * ``argument-name`` is any valid C++ identifier.
3029 * ``default-value`` is any valid C++ expression; if necessary, user code can
3030 compute it in terms of ``previous-name ## _type``, where ``previous-name``
3031 is the ``argument-name`` in a previous ``specifier-group0`` or
3032 ``specifier-group1``. *This expression will be invoked exactly once.*
3033 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
3034 be the type of the corresponding ``argument-name``, whose second argument
3035 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
3036 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
3037 of ``previous-name ## _type``.
3038 * ``type-name`` is either the name of a **target type** or an `MPL Binary
3039 Metafunction Class`_ whose first argument will be the type of the
3040 corresponding ``argument-name``, whose second argument will be the entire
3041 |ArgumentPack|_, and whose return type is the **target type**. If
3042 ``restriction`` uses this form, then the type of the generated name
3043 ``argument-name ## _type`` will be computed in terms of the **target
3044 type**, and the generated reference ``argument-name`` (but not its
3045 corresponding entry in ``args``) will be cast to that type.
3047 **Approximate expansion:**
3051 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
3052 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
3056 // If **result** is a template instantiation of |boost_enable_if|_\,
3057 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
3058 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
3059 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
3060 // |std_enable_if|_\:
3061 template <typename Args>
3062 using boost_param_result_const\_ ## __LINE__ ## operator = **result**;
3064 // If **result** is a simple return type:
3065 template <typename Args>
3066 struct boost_param_result_const\_ ## __LINE__ ## operator
3068 typedef **result** type;
3071 struct boost_param_params_const\_ ## __LINE__ ## operator
3073 *list of parameter specifications, based on arguments*
3078 typedef boost_param_params_const\_ ## __LINE__ ## operator
3079 boost_param_parameters_const\_ ## __LINE__ ## operator;
3081 template <typename A0, …, typename A ## **n**>
3082 **result** operator()(
3083 A0&& a0, …, A ## **n**\ && a ## **n**
3084 , typename boost_param_parameters_const\_ ## __LINE__ ## operator
3085 ::match<A0, …, A ## **n**>::type
3086 = boost_param_parameters_const\_ ## __LINE__ ## operator()
3089 return this->boost_param_impl_const ## __LINE__ ## operator(
3090 boost_param_parameters_const\_ ## __LINE__ ## operator()(
3091 |std_forward|_\<A0>(a0)
3093 , |std_forward|_\<A ## **n**>(a ## **n**)
3100 template <typename A0, …, typename A ## **m**>
3101 **result** operator()(
3102 A0&& a0, …, A ## **m**\ && a ## **m**
3103 , typename boost_param_parameters_const\_ ## __LINE__ ## operator
3104 ::match<A0, …, A ## **m**>::type
3105 = boost_param_parameters_const\_ ## __LINE__ ## operator()
3108 return this->boost_param_impl_const ## __LINE__ ## operator(
3109 boost_param_parameters_const\_ ## __LINE__ ## operator()(
3110 |std_forward|_\<A0>(a0)
3112 , |std_forward|_\<A ## **m**>(a ## **m**)
3117 template <typename Args>
3118 typename boost_param_result_const\_ ## __LINE__ ## operator<Args>::type
3119 boost_param_impl_const ## __LINE__ ## operator(Args const& args) const
3122 boost_param_dispatch_const_0boost\_ ## __LINE__ ## operator(
3124 typename boost_param_result_const\_ ## __LINE__ ## operator<
3130 typename |value_type|_\<
3132 , *keyword tag type of required parameter* ## **0**
3134 >(args[ *keyword object of required parameter* ## **0**])
3137 typename |value_type|_\<
3139 , *keyword tag type of required parameter* ## **n**
3141 >(args[ *keyword object of required parameter* ## **n**])
3148 , typename *argument name* ## **0** ## _type
3150 , typename *argument name* ## **n** ## _type
3153 boost_param_dispatch_const_0boost\_ ## __LINE__ ## operator(
3156 , *argument name* ## **0** ## _type&& *argument name* ## **0**
3158 , *argument name* ## **n** ## _type&& *argument name* ## **n**
3162 boost_param_dispatch_const_0boost\_ ## __LINE__ ## operator(
3163 static_cast<ResultType(*)()>(|std_nullptr|_\)
3164 , (args, *keyword object of optional parameter* ## **n + 1** =
3165 *default value of optional parameter* ## **n + 1**
3167 , |std_forward|_\<*argument name* ## **0** ## _type>(
3168 *argument name* ## **0**
3171 , |std_forward|_\<*argument name* ## **n** ## _type>(
3172 *argument name* ## **n**
3175 typename |value_type|_\<
3177 , *keyword tag type of optional parameter* ## **n + 1**
3179 >(*default value of optional parameter* ## **n + 1**)
3188 , typename *argument name* ## **0** ## _type
3190 , typename *argument name* ## **m** ## _type
3193 boost_param_dispatch_const_0boost\_ ## __LINE__ ## operator(
3196 , *argument name* ## **0** ## _type&& *argument name* ## **0**
3198 , *argument name* ## **m** ## _type&& *argument name* ## **m**
3201 .. |BOOST_PARAMETER_CONSTRUCTOR| replace:: ``BOOST_PARAMETER_CONSTRUCTOR``
3202 .. _BOOST_PARAMETER_CONSTRUCTOR:
3204 ``BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)``
3205 --------------------------------------------------------------------
3207 :Defined in: |preprocessor_header|_
3209 Generates a constructor that can take in positional arguments, composed
3210 arguments, named arguments, and deduced arguments.
3214 Define the named parameters that will comprise the argument specification that
3215 this macro will use. Ensure that all their tag types are in the same
3216 namespace, which is ``tag`` by default.
3220 |BOOST_PARAMETER_NAME|_\(y)
3221 |BOOST_PARAMETER_NAME|_\(z)
3223 In the base class, implement a delegate constructor template that takes in an
3224 |ArgumentPack|_. You must pass the identifiers with leading underscores to
3225 ``args`` in order to extract the corresponding arguments.
3229 class char_read_base
3235 template <typename Args>
3236 explicit char_read_base(Args const& args)
3237 : index(args[_y]), key(args[_z])
3241 |BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR|_\((char), tag,
3245 (z, (|std_map|_\<char const*, |std_string|_\>))
3251 (z.find(this->key)->second)[this->index]
3252 ) : this->key[this->index];
3256 Use the macro as a substitute for a normal constructor definition. Note the
3257 lack of an explicit body. Enclose the base type in parentheses. For each
3258 parameter, also enclose the expected value type in parentheses. Since the
3259 value types are mutually exclusive, you can wrap the parameters in a
3260 ``(deduced …)`` clause.
3264 struct char_reader : public char_read_base
3266 BOOST_PARAMETER_CONSTRUCTOR(char_reader, (char_read_base), tag,
3276 The following ``char_reader`` constructor calls are legal.
3280 char const* keys[] = {"foo", "bar", "baz"};
3281 |std_map|_\<char const*, |std_string|_\> k2s;
3282 k2s[keys[0]] = |std_string|_\("qux");
3283 k2s[keys[1]] = |std_string|_\("wmb");
3284 k2s[keys[2]] = |std_string|_\("zxc");
3286 // positional arguments
3287 char_reader r0(0, keys[0]);
3288 BOOST_TEST_EQ('q', (r0(true, k2s)));
3289 BOOST_TEST_EQ('f', (r0(false, k2s)));
3292 char_reader r1(_z = keys[1], _y = 1);
3293 BOOST_TEST_EQ('m', (r1(_z = k2s, _y = true)));
3294 BOOST_TEST_EQ('a', (r1(_z = k2s, _y = false)));
3296 // deduced arguments
3297 char_reader r2(keys[2], 2);
3298 BOOST_TEST_EQ('c', (r2(k2s, true)));
3299 BOOST_TEST_EQ('z', (r2(k2s, false)));
3301 The |preprocessor_cpp|_ and |preprocessor_deduced_cpp|_ test programs
3302 demonstrate proper usage of this macro.
3304 **Macro parameters:**
3306 * ``cls`` is the name of the enclosing class.
3307 * ``impl`` is the parenthesized implementation base class for ``cls``.
3308 * ``tag_namespace`` is the namespace in which the keywords used by the
3309 constructor resides.
3310 * ``arguments`` is a list of *argument-specifiers*, as defined below.
3312 **Argument specifiers syntax:**
3316 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
3318 specifier-group0 ::= *specifier-group1* |
3320 '**(**' '**deduced**'
3321 *specifier-group1* {*specifier-group1*\ }
3325 specifier-group1 ::=
3327 '**(**' '**optional**'
3328 *specifier* {*specifier*\ }
3331 '**(**' '**required**'
3332 *specifier* {*specifier*\ }
3337 '**(**' *argument-name* '**,**' *restriction* ')'
3340 ( '**\***' '**(**' *mfc* '**)**' ) |
3341 ( '**(**' *type-name* '**)**' ) |
3344 * ``argument-name`` is any valid C++ identifier.
3345 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
3346 be the type of the corresponding ``argument-name``, whose second argument
3347 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
3348 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
3349 of ``previous-name ## _type``.
3350 * ``type-name`` is either the name of a **target type** or an `MPL Binary
3351 Metafunction Class`_ whose first argument will be the type of the
3352 corresponding ``argument-name``, whose second argument will be the entire
3353 |ArgumentPack|_, and whose return type is the **target type**.
3355 Note that *specifier* does not include *default-value*. It is up to the
3356 delegate constructor in ``impl`` to determine the default value of all
3359 **Approximate expansion:**
3363 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
3364 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
3368 struct boost_param_params\_ ## __LINE__ ## ctor
3370 *list of parameter specifications, based on arguments*
3375 typedef boost_param_params\_ ## __LINE__ ## ctor
3376 constructor_parameters ## __LINE__;
3378 template <typename A0, …, typename A ## **n**>
3379 **cls**\ (A0&& a0, …, A ## **n** && a ## **n**)
3381 constructor_parameters ## __LINE__(
3382 |std_forward|_\<A0>(a0)
3384 , |std_forward|_\<A ## **n**>(a ## **n**)
3392 template <typename A0, …, typename A ## **m**>
3393 **cls**\ (A0&& a0, …, A ## **m** && a ## **m**)
3395 constructor_parameters ## __LINE__(
3396 |std_forward|_\<A0>(a0)
3398 , |std_forward|_\<A ## **m**>(a ## **m**)
3404 .. |BOOST_PARAMETER_BASIC_FUNCTION| replace:: ``BOOST_PARAMETER_BASIC_FUNCTION``
3405 .. _BOOST_PARAMETER_BASIC_FUNCTION:
3407 ``BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, arguments)``
3408 --------------------------------------------------------------------------
3410 :Defined in: |preprocessor_header|_
3412 Generates a function that can take in positional arguments, composed
3413 arguments, named arguments, and deduced arguments.
3417 The return type of each of the following function templates falls under a
3418 different value category.
3422 template <std::size_t N>
3423 |std_bitset|_\<N + 1> rvalue_bitset()
3425 return |std_bitset|_\<N + 1>();
3428 template <std::size_t N>
3429 |std_bitset|_\<N + 1> const rvalue_const_bitset()
3431 return |std_bitset|_\<N + 1>();
3434 template <std::size_t N>
3435 |std_bitset|_\<N + 1>& lvalue_bitset()
3437 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
3441 template <std::size_t N>
3442 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
3444 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
3448 The ``U::evaluate_category`` static member function template has a simple job:
3449 to return the correct value category when passed in an object returned by one
3450 of the functions defined above. Assume that
3451 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
3457 passed_by_lvalue_reference_to_const
3458 , passed_by_lvalue_reference
3459 , passed_by_rvalue_reference_to_const
3460 , passed_by_rvalue_reference
3465 template <std::size_t N>
3466 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
3468 return passed_by_lvalue_reference_to_const;
3471 template <std::size_t N>
3472 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
3474 return passed_by_lvalue_reference;
3477 template <std::size_t N>
3478 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
3480 return passed_by_rvalue_reference_to_const;
3483 template <std::size_t N>
3484 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
3486 return passed_by_rvalue_reference;
3490 Define the named parameters that will comprise the argument specification that
3491 this macro will use. Ensure that all their tag types are in the same
3492 namespace, which is ``kw`` in this case. The identifiers with leading
3493 underscores can be passed to the bracket operator of ``args`` to extract the
3494 same argument to which the corresponding named parameter (without underscores)
3495 is bound, as will be shown later.
3499 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
3500 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
3501 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
3502 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
3504 Use the macro as a substitute for a normal function header. Enclose the
3505 return type ``bool`` in parentheses. For each parameter, also enclose the
3506 expected value type in parentheses. Since the value types are mutually
3507 exclusive, you can wrap the parameters in a ``(deduced …)``
3508 clause. Otherwise, just as with a normal function, the order in which you
3509 specify the parameters determines their position. However, unlike a normal
3510 function, default values must be specified within the function body. Also
3511 within the function body, you must pass the matching identifier with the
3512 leading underscore to the bracket operator of ``args`` to extract the
3513 corresponding argument, but at least this doesn't require ``std::forward`` to
3514 preserve value categories.
3518 BOOST_PARAMETER_BASIC_FUNCTION((bool), evaluate, kw,
3521 (lrc, (|std_bitset|_\<1>))
3522 (lr, (|std_bitset|_\<2>))
3525 (rrc, (|std_bitset|_\<3>))
3526 (rr, (|std_bitset|_\<4>))
3532 passed_by_lvalue_reference_to_const
3533 , U::evaluate_category<0>(args[_lrc])
3536 passed_by_lvalue_reference
3537 , U::evaluate_category<1>(args[_lr])
3540 passed_by_rvalue_reference_to_const
3541 , U::evaluate_category<2>(
3542 args[_rrc0 | rvalue_const_bitset<2>()]
3546 passed_by_rvalue_reference
3547 , U::evaluate_category<3>(args[_rr0 | rvalue_bitset<3>()])
3553 The following function calls are legal.
3557 evaluate( // positional arguments
3558 lvalue_const_bitset<0>()
3559 , lvalue_bitset<1>()
3560 , rvalue_const_bitset<2>()
3561 , rvalue_bitset<3>()
3563 evaluate( // positional arguments
3564 lvalue_const_bitset<0>()
3565 , lvalue_bitset<1>()
3567 evaluate(( // composed arguments
3568 _rr0 = rvalue_bitset<3>()
3569 , _lrc0 = lvalue_const_bitset<0>()
3570 , _lr0 = lvalue_bitset<1>()
3571 , _rrc0 = rvalue_const_bitset<2>()
3573 evaluate( // named arguments
3574 _rr0 = rvalue_bitset<3>()
3575 , _lrc0 = lvalue_const_bitset<0>()
3576 , _lr0 = lvalue_bitset<1>()
3577 , _rrc0 = rvalue_const_bitset<2>()
3579 evaluate( // named arguments
3580 _lr0 = lvalue_bitset<1>()
3581 , _lrc0 = lvalue_const_bitset<0>()
3584 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
3585 function calls are also legal.
3589 evaluate( // deduced arguments
3591 , lvalue_const_bitset<0>()
3592 , lvalue_bitset<1>()
3593 , rvalue_const_bitset<2>()
3595 evaluate( // deduced arguments
3597 , lvalue_const_bitset<0>()
3600 The |preprocessor_cpp|_ test program demonstrates proper usage of this macro.
3602 **Macro parameters:**
3604 * ``result`` is the parenthesized return type of the function.
3605 * ``name`` is the base name of the function; it determines the name of the
3606 generated forwarding functions.
3607 * ``tag_namespace`` is the namespace in which the keywords used by the
3609 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
3610 *argument-specifiers*, as defined below.
3612 **Argument specifiers syntax:**
3616 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
3618 specifier-group0 ::= *specifier-group1* |
3620 '**(**' '**deduced**'
3621 *specifier-group1* {*specifier-group1*\ }
3625 specifier-group1 ::=
3627 '**(**' '**optional**'
3628 *specifier* {*specifier*\ }
3631 '**(**' '**required**'
3632 *specifier* {*specifier*\ }
3637 '**(**' *argument-name* '**,**' *restriction* ')'
3640 ( '**\***' '**(**' *mfc* '**)**' ) |
3641 ( '**(**' *type-name* '**)**' ) |
3644 * ``argument-name`` is any valid C++ identifier.
3645 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
3646 be the type of the corresponding ``argument-name``, whose second argument
3647 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
3648 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
3649 of ``previous-name ## _type``.
3650 * ``type-name`` is either the name of a **target type** or an `MPL Binary
3651 Metafunction Class`_ whose first argument will be the type of the
3652 corresponding ``argument-name``, whose second argument will be the entire
3653 |ArgumentPack|_, and whose return type is the **target type**.
3655 Note that *specifier* does not include *default-value*. It is up to the
3656 function body to determine the default value of all optional arguments.
3658 **Approximate expansion:**
3662 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
3663 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
3667 // If **result** is a template instantiation of |boost_enable_if|_\,
3668 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
3669 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
3670 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
3671 // |std_enable_if|_\:
3672 template <typename Args>
3673 using boost_param_result\_ ## __LINE__ ## **name** = **result**;
3675 // If **result** is a simple return type:
3676 template <typename Args>
3677 struct boost_param_result\_ ## __LINE__ ## **name**
3679 typedef **result** type;
3682 struct boost_param_params\_ ## __LINE__ ## **name**
3684 *list of parameter specifications, based on arguments*
3689 typedef boost_param_params\_ ## __LINE__ ## **name**
3690 boost_param_parameters\_ ## __LINE__ ## **name**;
3692 template <typename Args>
3693 typename boost_param_result\_ ## __LINE__ ## **name**\ <Args>::type
3694 boost_param_impl ## **name**\ (Args const&);
3696 template <typename A0, …, typename A ## **n**>
3697 **result** **name**\ (
3698 A0&& a0, …, A ## **n**\ && a ## **n**
3699 , typename boost_param_parameters\_ ## __LINE__ ## **name**
3700 ::match<A0, …, A ## **n**>::type
3701 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
3704 return boost_param_impl ## __LINE__ ## **name**\ (
3705 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
3706 |std_forward|_\<A0>(a0)
3708 , |std_forward|_\<A ## **n**>(a ## **n**)
3715 template <typename A0, …, typename A ## **m**>
3716 **result** **name**\ (
3717 A0&& a0, …, A ## **m**\ && a ## **m**
3718 , typename boost_param_parameters\_ ## __LINE__ ## **name**
3719 ::match<A0, …, A ## **m**>::type
3720 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
3723 return boost_param_impl ## __LINE__ ## **name**\ (
3724 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
3725 |std_forward|_\<A0>(a0)
3727 , |std_forward|_\<A ## **m**>(a ## **m**)
3732 template <typename Args>
3733 typename boost_param_result\_ ## __LINE__ ## **name**\ <Args>::type
3734 boost_param_impl ## __LINE__ ## **name**\ (Args const& args)
3736 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
3737 available for use within the function body.
3739 .. |BOOST_PARAMETER_BASIC_MEMBER_FUNCTION| replace:: ``BOOST_PARAMETER_BASIC_MEMBER_FUNCTION``
3740 .. _BOOST_PARAMETER_BASIC_MEMBER_FUNCTION:
3742 ``BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_ns, arguments)``
3743 --------------------------------------------------------------------------
3745 :Defined in: |preprocessor_header|_
3747 Generates a member function that can take in positional arguments, composed
3748 arguments, named arguments, and deduced arguments.
3752 The return type of each of the following function templates falls under a
3753 different value category.
3757 template <std::size_t N>
3758 |std_bitset|_\<N + 1> rvalue_bitset()
3760 return |std_bitset|_\<N + 1>();
3763 template <std::size_t N>
3764 |std_bitset|_\<N + 1> const rvalue_const_bitset()
3766 return |std_bitset|_\<N + 1>();
3769 template <std::size_t N>
3770 |std_bitset|_\<N + 1>& lvalue_bitset()
3772 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
3776 template <std::size_t N>
3777 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
3779 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
3783 The ``U::evaluate_category`` static member function template has a simple job:
3784 to return the correct value category when passed in an object returned by one
3785 of the functions defined above. Assume that
3786 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
3792 passed_by_lvalue_reference_to_const
3793 , passed_by_lvalue_reference
3794 , passed_by_rvalue_reference_to_const
3795 , passed_by_rvalue_reference
3800 template <std::size_t N>
3801 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
3803 return passed_by_lvalue_reference_to_const;
3806 template <std::size_t N>
3807 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
3809 return passed_by_lvalue_reference;
3812 template <std::size_t N>
3813 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
3815 return passed_by_rvalue_reference_to_const;
3818 template <std::size_t N>
3819 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
3821 return passed_by_rvalue_reference;
3825 Define the named parameters that will comprise the argument specification that
3826 this macro will use. Ensure that all their tag types are in the same
3827 namespace, which is ``kw`` in this case. The identifiers with leading
3828 underscores can be passed to the bracket operator of ``args`` to extract the
3829 same argument to which the corresponding named parameter (without underscores)
3830 is bound, as will be shown later.
3834 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
3835 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
3836 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
3837 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
3839 Use the macro as a substitute for a normal ``static`` member function
3840 header. Enclose the return type ``bool`` in parentheses. For each parameter,
3841 also enclose the expected value type in parentheses. Since the value types
3842 are mutually exclusive, you can wrap the parameters in a ``(deduced …)``
3843 clause. Otherwise, just as with a normal function, the order in which you
3844 specify the parameters determines their position. However, unlike a normal
3845 function, default values must be specified within the function body. Also
3846 within the function body, you must pass the matching identifier with the
3847 leading underscore to the bracket operator of ``args`` to extract the
3848 corresponding argument, but at least this doesn't require ``std::forward`` to
3849 preserve value categories.
3855 BOOST_PARAMETER_BASIC_MEMBER_FUNCTION((bool), static evaluate, kw,
3858 (lrc, (|std_bitset|_\<1>))
3859 (lr, (|std_bitset|_\<2>))
3862 (rrc, (|std_bitset|_\<3>))
3863 (rr, (|std_bitset|_\<4>))
3869 passed_by_lvalue_reference_to_const
3870 , U::evaluate_category<0>(args[_lrc])
3873 passed_by_lvalue_reference
3874 , U::evaluate_category<1>(args[_lr])
3877 passed_by_rvalue_reference_to_const
3878 , U::evaluate_category<2>(
3879 args[_rrc0 | rvalue_const_bitset<2>()]
3883 passed_by_rvalue_reference
3884 , U::evaluate_category<3>(
3885 args[_rr0 | rvalue_bitset<3>()]
3893 The following function calls are legal.
3897 B::evaluate( // positional arguments
3898 lvalue_const_bitset<0>()
3899 , lvalue_bitset<1>()
3900 , rvalue_const_bitset<2>()
3901 , rvalue_bitset<3>()
3903 B::evaluate( // positional arguments
3904 lvalue_const_bitset<0>()
3905 , lvalue_bitset<1>()
3907 B::evaluate(( // composed arguments
3908 _rr0 = rvalue_bitset<3>()
3909 , _lrc0 = lvalue_const_bitset<0>()
3910 , _lr0 = lvalue_bitset<1>()
3911 , _rrc0 = rvalue_const_bitset<2>()
3913 B::evaluate( // named arguments
3914 _rr0 = rvalue_bitset<3>()
3915 , _lrc0 = lvalue_const_bitset<0>()
3916 , _lr0 = lvalue_bitset<1>()
3917 , _rrc0 = rvalue_const_bitset<2>()
3919 B::evaluate( // named arguments
3920 _lr0 = lvalue_bitset<1>()
3921 , _lrc0 = lvalue_const_bitset<0>()
3924 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
3925 function calls are also legal.
3929 B::evaluate( // deduced arguments
3931 , lvalue_const_bitset<0>()
3932 , lvalue_bitset<1>()
3933 , rvalue_const_bitset<2>()
3935 B::evaluate( // deduced arguments
3937 , lvalue_const_bitset<0>()
3940 The |preprocessor_cpp|_ test program demonstrates proper usage of this macro.
3942 **Macro parameters:**
3944 * ``result`` is the parenthesized return type of the function.
3945 * ``name`` is the base name of the function; it determines the name of the
3946 generated forwarding functions. ``name`` may be qualified by the
3947 ``static`` keyword to declare the member function and its helpers as not
3948 associated with any object of the enclosing type.
3949 * ``tag_namespace`` is the namespace in which the keywords used by the
3951 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
3952 *argument-specifiers*, as defined below.
3954 **Argument specifiers syntax:**
3958 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
3960 specifier-group0 ::= *specifier-group1* |
3962 '**(**' '**deduced**'
3963 *specifier-group1* {*specifier-group1*\ }
3967 specifier-group1 ::=
3969 '**(**' '**optional**'
3970 *specifier* {*specifier*\ }
3973 '**(**' '**required**'
3974 *specifier* {*specifier*\ }
3979 '**(**' *argument-name* '**,**' *restriction* ')'
3982 ( '**\***' '**(**' *mfc* '**)**' ) |
3983 ( '**(**' *type-name* '**)**' ) |
3986 * ``argument-name`` is any valid C++ identifier.
3987 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
3988 be the type of the corresponding ``argument-name``, whose second argument
3989 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
3990 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
3991 of ``previous-name ## _type``.
3992 * ``type-name`` is either the name of a **target type** or an `MPL Binary
3993 Metafunction Class`_ whose first argument will be the type of the
3994 corresponding ``argument-name``, whose second argument will be the entire
3995 |ArgumentPack|_, and whose return type is the **target type**.
3997 Note that *specifier* does not include *default-value*. It is up to the
3998 function body to determine the default value of all optional arguments.
4000 **Approximate expansion:**
4004 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
4005 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
4009 // If **result** is a template instantiation of |boost_enable_if|_\,
4010 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
4011 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
4012 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
4013 // |std_enable_if|_\:
4014 template <typename Args>
4015 using boost_param_result\_ ## __LINE__ ## **name** = **result**;
4017 // If **result** is a simple return type:
4018 template <typename Args>
4019 struct boost_param_result\_ ## __LINE__ ## **name**
4021 typedef **result** type;
4024 struct boost_param_params\_ ## __LINE__ ## **name**
4026 *list of parameter specifications, based on arguments*
4031 typedef boost_param_params\_ ## __LINE__ ## **name**
4032 boost_param_parameters\_ ## __LINE__ ## **name**;
4034 template <typename A0, …, typename A ## **n**>
4035 **result** **name**\ (
4036 A0&& a0, …, A ## **n**\ && a ## **n**
4037 , typename boost_param_parameters\_ ## __LINE__ ## **name**
4038 ::match<A0, …, A ## **n**>::type
4039 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
4042 return this->boost_param_impl ## **name**\ (
4043 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
4044 |std_forward|_\<A0>(a0)
4046 , |std_forward|_\<A ## **n**>(a ## **n**)
4053 template <typename A0, …, typename A ## **m**>
4054 **result** **name**\ (
4055 A0&& a0, …, A ## **m**\ && a ## **m**
4056 , typename boost_param_parameters\_ ## __LINE__ ## **name**
4057 ::match<A0, …, A ## **m**>::type
4058 = boost_param_parameters\_ ## __LINE__ ## **name**\ ()
4061 return this->boost_param_impl ## **name**\ (
4062 boost_param_parameters\_ ## __LINE__ ## **name**\ ()(
4063 |std_forward|_\<A0>(a0)
4065 , |std_forward|_\<A ## **m**>(a ## **m**)
4070 template <typename Args>
4071 typename boost_param_result\_ ## __LINE__ ## **name**\ <Args>::type
4072 boost_param_impl ## **name**\ (Args const& args)
4074 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
4075 available for use within the function body.
4077 .. |BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION| replace:: ``BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION``
4078 .. _BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION:
4080 ``BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_ns, args)``
4081 ---------------------------------------------------------------------------
4083 :Defined in: |preprocessor_header|_
4085 Generates a member function that can take in positional arguments, composed
4086 arguments, named arguments, and deduced arguments.
4090 The return type of each of the following function templates falls under a
4091 different value category.
4095 template <std::size_t N>
4096 |std_bitset|_\<N + 1> rvalue_bitset()
4098 return |std_bitset|_\<N + 1>();
4101 template <std::size_t N>
4102 |std_bitset|_\<N + 1> const rvalue_const_bitset()
4104 return |std_bitset|_\<N + 1>();
4107 template <std::size_t N>
4108 |std_bitset|_\<N + 1>& lvalue_bitset()
4110 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
4114 template <std::size_t N>
4115 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
4117 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
4121 The ``U::evaluate_category`` static member function template has a simple job:
4122 to return the correct value category when passed in an object returned by one
4123 of the functions defined above. Assume that
4124 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
4130 passed_by_lvalue_reference_to_const
4131 , passed_by_lvalue_reference
4132 , passed_by_rvalue_reference_to_const
4133 , passed_by_rvalue_reference
4138 template <std::size_t N>
4139 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
4141 return passed_by_lvalue_reference_to_const;
4144 template <std::size_t N>
4145 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
4147 return passed_by_lvalue_reference;
4150 template <std::size_t N>
4151 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
4153 return passed_by_rvalue_reference_to_const;
4156 template <std::size_t N>
4157 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
4159 return passed_by_rvalue_reference;
4163 Define the named parameters that will comprise the argument specification that
4164 this macro will use. Ensure that all their tag types are in the same
4165 namespace, which is ``kw`` in this case. The identifiers with leading
4166 underscores can be passed to the bracket operator of ``args`` to extract the
4167 same argument to which the corresponding named parameter (without underscores)
4168 is bound, as will be shown later.
4172 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
4173 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
4174 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
4175 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
4177 Use the macro as a substitute for a normal ``const`` member function
4178 header. Enclose the return type ``bool`` in parentheses. For each parameter,
4179 also enclose the expected value type in parentheses. Since the value types
4180 are mutually exclusive, you can wrap the parameters in a ``(deduced …)``
4181 clause. Otherwise, just as with a normal function, the order in which you
4182 specify the parameters determines their position. However, unlike a normal
4183 function, default values must be specified within the function body. Also
4184 within the function body, you must pass the matching identifier with the
4185 leading underscore to the bracket operator of ``args`` to extract the
4186 corresponding argument, but at least this doesn't require ``std::forward`` to
4187 preserve value categories.
4197 BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
4200 (lrc, (|std_bitset|_\<1>))
4201 (lr, (|std_bitset|_\<2>))
4204 (rrc, (|std_bitset|_\<3>))
4205 (rr, (|std_bitset|_\<4>))
4211 passed_by_lvalue_reference_to_const
4212 , U::evaluate_category<0>(args[_lrc])
4215 passed_by_lvalue_reference
4216 , U::evaluate_category<1>(args[_lr])
4219 passed_by_rvalue_reference_to_const
4220 , U::evaluate_category<2>(
4221 args[_rrc0 | rvalue_const_bitset<2>()]
4225 passed_by_rvalue_reference
4226 , U::evaluate_category<3>(
4227 args[_rr0 | rvalue_bitset<3>()]
4235 The following function calls are legal.
4240 b.evaluate( // positional arguments
4241 lvalue_const_bitset<0>()
4242 , lvalue_bitset<1>()
4243 , rvalue_const_bitset<2>()
4244 , rvalue_bitset<3>()
4246 b.evaluate( // positional arguments
4247 lvalue_const_bitset<0>()
4248 , lvalue_bitset<1>()
4250 b.evaluate(( // composed arguments
4251 _rr0 = rvalue_bitset<3>()
4252 , _lrc0 = lvalue_const_bitset<0>()
4253 , _lr0 = lvalue_bitset<1>()
4254 , _rrc0 = rvalue_const_bitset<2>()
4256 b.evaluate( // named arguments
4257 _rr0 = rvalue_bitset<3>()
4258 , _lrc0 = lvalue_const_bitset<0>()
4259 , _lr0 = lvalue_bitset<1>()
4260 , _rrc0 = rvalue_const_bitset<2>()
4262 b.evaluate( // named arguments
4263 _lr0 = lvalue_bitset<1>()
4264 , _lrc0 = lvalue_const_bitset<0>()
4267 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
4268 function calls are also legal.
4272 b.evaluate( // deduced arguments
4274 , lvalue_const_bitset<0>()
4275 , lvalue_bitset<1>()
4276 , rvalue_const_bitset<2>()
4278 b.evaluate( // deduced arguments
4280 , lvalue_const_bitset<0>()
4283 The |preprocessor_cpp|_ test program demonstrates proper usage of this macro.
4285 **Macro parameters:**
4287 * ``result`` is the parenthesized return type of the function.
4288 * ``name`` is the base name of the function; it determines the name of the
4289 generated forwarding functions.
4290 * ``tag_namespace`` is the namespace in which the keywords used by the
4292 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
4293 *argument-specifiers*, as defined below.
4295 **Argument specifiers syntax:**
4299 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
4301 specifier-group0 ::= *specifier-group1* |
4303 '**(**' '**deduced**'
4304 *specifier-group1* {*specifier-group1*\ }
4308 specifier-group1 ::=
4310 '**(**' '**optional**'
4311 *specifier* {*specifier*\ }
4314 '**(**' '**required**'
4315 *specifier* {*specifier*\ }
4320 '**(**' *argument-name* '**,**' *restriction* ')'
4323 ( '**\***' '**(**' *mfc* '**)**' ) |
4324 ( '**(**' *type-name* '**)**' ) |
4327 * ``argument-name`` is any valid C++ identifier.
4328 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
4329 be the type of the corresponding ``argument-name``, whose second argument
4330 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
4331 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
4332 of ``previous-name ## _type``.
4333 * ``type-name`` is either the name of a **target type** or an `MPL Binary
4334 Metafunction Class`_ whose first argument will be the type of the
4335 corresponding ``argument-name``, whose second argument will be the entire
4336 |ArgumentPack|_, and whose return type is the **target type**.
4338 Note that *specifier* does not include *default-value*. It is up to the
4339 function body to determine the default value of all optional arguments.
4341 **Approximate expansion:**
4345 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
4346 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
4350 // If **result** is a template instantiation of |boost_enable_if|_\,
4351 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
4352 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
4353 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
4354 // |std_enable_if|_\:
4355 template <typename Args>
4356 using boost_param_result_const\_ ## __LINE__ ## **name** = **result**;
4358 // If **result** is a simple return type:
4359 template <typename Args>
4360 struct boost_param_result_const\_ ## __LINE__ ## **name**
4362 typedef **result** type;
4365 struct boost_param_params_const\_ ## __LINE__ ## **name**
4367 *list of parameter specifications, based on arguments*
4372 typedef boost_param_params_const\_ ## __LINE__ ## **name**
4373 boost_param_parameters_const\_ ## __LINE__ ## **name**;
4375 template <typename A0, …, typename A ## **n**>
4376 **result** **name**\ (
4377 A0&& a0, …, A ## **n**\ && a ## **n**
4378 , typename boost_param_parameters_const\_ ## __LINE__ ## **name**
4379 ::match<A0, …, A ## **n**>::type
4380 = boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()
4383 return this->boost_param_impl_const ## __LINE__ ## **name**\ (
4384 boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()(
4385 |std_forward|_\<A0>(a0)
4387 , |std_forward|_\<A ## **n**>(a ## **n**)
4394 template <typename A0, …, typename A ## **m**>
4395 **result** **name**\ (
4396 A0&& a0, …, A ## **m**\ && a ## **m**
4397 , typename boost_param_parameters_const\_ ## __LINE__ ## **name**
4398 ::match<A0, …, A ## **m**>::type
4399 = boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()
4402 return this->boost_param_impl_const ## __LINE__ ## **name**\ (
4403 boost_param_parameters_const\_ ## __LINE__ ## **name**\ ()(
4404 |std_forward|_\<A0>(a0)
4406 , |std_forward|_\<A ## **m**>(a ## **m**)
4411 template <typename Args>
4412 typename boost_param_result_const\_ ## __LINE__ ## **name**\ <Args>::type
4413 boost_param_impl_const ## __LINE__ ## **name**\ (Args const& args) const
4415 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
4416 available for use within the function body.
4418 .. |BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR| replace:: ``BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR``
4419 .. _BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR:
4421 ``BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)``
4422 ---------------------------------------------------------------------------
4424 :Defined in: |preprocessor_header|_
4426 Generates a function call operator that can take in positional arguments,
4427 composed arguments, named arguments, and deduced arguments.
4431 Define the named parameters that will comprise the argument specification that
4432 this macro will use. Ensure that all their tag types are in the same
4433 namespace, which is ``tag`` by default.
4437 |BOOST_PARAMETER_NAME|_\(y)
4438 |BOOST_PARAMETER_NAME|_\(z)
4440 Use the macro as a substitute for a normal function call operator
4441 header. Enclose the return type in parentheses. For each parameter, also
4442 enclose the expected value type in parentheses. Since the value types are
4443 mutually exclusive, you can wrap the parameters in a ``(deduced …)``
4444 clause. This is especially useful when implementing multiple
4445 Boost.Parameter-enabled function call operator overloads.
4455 explicit char_reader(char const* k) : index(0), key(k)
4459 BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR((void), tag,
4468 this->index = args[_y];
4469 this->key = args[_z];
4472 |BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR|_\((char), tag,
4476 (z, (|std_map|_\<char const*, |std_string|_\>))
4482 (args[_z].find(this->key)->second)[this->index]
4483 ) : this->key[this->index];
4487 As with regular argument-dependent lookup, the value types of the arguments
4488 passed in determine which function call operator overload gets invoked.
4492 char const* keys[] = {"foo", "bar", "baz"};
4493 |std_map|_\<char const*, |std_string|_\> k2s;
4494 k2s[keys[0]] = |std_string|_\("qux");
4495 k2s[keys[1]] = |std_string|_\("wmb");
4496 k2s[keys[2]] = |std_string|_\("zxc");
4497 char_reader r(keys[0]);
4499 // positional arguments
4500 BOOST_TEST_EQ('q', (r(true, k2s)));
4501 BOOST_TEST_EQ('f', (r(false, k2s)));
4504 r(_z = keys[1], _y = 1);
4505 BOOST_TEST_EQ('m', (r(_z = k2s, _y = true)));
4506 BOOST_TEST_EQ('a', (r(_z = k2s, _y = false)));
4508 // deduced arguments
4510 BOOST_TEST_EQ('c', (r(k2s, true)));
4511 BOOST_TEST_EQ('z', (r(k2s, false)));
4513 The |preprocessor_cpp|_ test program demonstrates proper usage of this macro.
4515 **Macro parameters:**
4517 * ``result`` is the parenthesized return type of the function call operator.
4518 * ``tag_namespace`` is the namespace in which the keywords used by the
4519 function call operator resides.
4520 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
4521 *argument-specifiers*, as defined below.
4523 **Argument specifiers syntax:**
4527 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
4529 specifier-group0 ::= *specifier-group1* |
4531 '**(**' '**deduced**'
4532 *specifier-group1* {*specifier-group1*\ }
4536 specifier-group1 ::=
4538 '**(**' '**optional**'
4539 *specifier* {*specifier*\ }
4542 '**(**' '**required**'
4543 *specifier* {*specifier*\ }
4548 '**(**' *argument-name* '**,**' *restriction* ')'
4551 ( '**\***' '**(**' *mfc* '**)**' ) |
4552 ( '**(**' *type-name* '**)**' ) |
4555 * ``argument-name`` is any valid C++ identifier.
4556 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
4557 be the type of the corresponding ``argument-name``, whose second argument
4558 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
4559 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
4560 of ``previous-name ## _type``.
4561 * ``type-name`` is either the name of a **target type** or an `MPL Binary
4562 Metafunction Class`_ whose first argument will be the type of the
4563 corresponding ``argument-name``, whose second argument will be the entire
4564 |ArgumentPack|_, and whose return type is the **target type**.
4566 Note that *specifier* does not include *default-value*. It is up to the
4567 function body to determine the default value of all optional arguments.
4569 **Approximate expansion:**
4573 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
4574 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
4578 // If **result** is a template instantiation of |boost_enable_if|_\,
4579 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
4580 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
4581 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
4582 // |std_enable_if|_\:
4583 template <typename Args>
4584 using boost_param_result\_ ## __LINE__ ## operator = **result**;
4586 // If **result** is a simple return type:
4587 template <typename Args>
4588 struct boost_param_result\_ ## __LINE__ ## operator
4590 typedef **result** type;
4593 struct boost_param_params\_ ## __LINE__ ## operator
4595 *list of parameter specifications, based on arguments*
4600 typedef boost_param_params\_ ## __LINE__ ## operator
4601 boost_param_parameters\_ ## __LINE__ ## operator;
4603 template <typename A0, …, typename A ## **n**>
4604 **result** operator()(
4605 A0&& a0, …, A ## **n**\ && a ## **n**
4606 , typename boost_param_parameters\_ ## __LINE__ ## operator::match<
4608 >::type = boost_param_parameters\_ ## __LINE__ ## operator()
4611 return this->boost_param_impl ## __LINE__ ## operator(
4612 boost_param_parameters\_ ## __LINE__ ## operator()(
4613 |std_forward|_\<A0>(a0)
4615 , |std_forward|_\<A ## **n**>(a ## **n**)
4622 template <typename A0, …, typename A ## **m**>
4623 **result** operator()(
4624 A0&& a0, …, A ## **m**\ && a ## **m**
4625 , typename boost_param_parameters\_ ## __LINE__ ## operator::match<
4627 >::type = boost_param_parameters\_ ## __LINE__ ## operator()
4630 return this->boost_param_impl ## __LINE__ ## operator(
4631 boost_param_parameters\_ ## __LINE__ ## operator()(
4632 |std_forward|_\<A0>(a0)
4634 , |std_forward|_\<A ## **m**>(a ## **m**)
4639 template <typename Args>
4640 typename boost_param_result\_ ## __LINE__ ## operator<Args>::type
4641 boost_param_impl ## __LINE__ ## operator(Args const& args)
4643 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
4644 available for use within the function call operator body.
4646 .. |BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR| replace:: ``BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR``
4647 .. _BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR:
4649 ``BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, args)``
4650 ----------------------------------------------------------------------------
4652 :Defined in: |preprocessor_header|_
4654 Generates a function call operator that can take in positional arguments,
4655 composed arguments, named arguments, and deduced arguments.
4659 The return type of each of the following function templates falls under a
4660 different value category.
4664 template <std::size_t N>
4665 |std_bitset|_\<N + 1> rvalue_bitset()
4667 return |std_bitset|_\<N + 1>();
4670 template <std::size_t N>
4671 |std_bitset|_\<N + 1> const rvalue_const_bitset()
4673 return |std_bitset|_\<N + 1>();
4676 template <std::size_t N>
4677 |std_bitset|_\<N + 1>& lvalue_bitset()
4679 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
4683 template <std::size_t N>
4684 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
4686 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
4690 The ``U::evaluate_category`` static member function template has a simple job:
4691 to return the correct value category when passed in an object returned by one
4692 of the functions defined above. Assume that
4693 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
4699 passed_by_lvalue_reference_to_const
4700 , passed_by_lvalue_reference
4701 , passed_by_rvalue_reference_to_const
4702 , passed_by_rvalue_reference
4707 template <std::size_t N>
4708 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
4710 return passed_by_lvalue_reference_to_const;
4713 template <std::size_t N>
4714 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
4716 return passed_by_lvalue_reference;
4719 template <std::size_t N>
4720 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
4722 return passed_by_rvalue_reference_to_const;
4725 template <std::size_t N>
4726 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
4728 return passed_by_rvalue_reference;
4732 Define the named parameters that will comprise the argument specification that
4733 this macro will use. Ensure that all their tag types are in the same
4734 namespace, which is ``kw`` in this case. The identifiers with leading
4735 underscores can be passed to the bracket operator of ``args`` to extract the
4736 same argument to which the corresponding named parameter (without underscores)
4737 is bound, as will be shown later.
4741 |BOOST_PARAMETER_NAME|_\((_lrc, kw) in(lrc))
4742 |BOOST_PARAMETER_NAME|_\((_lr, kw) in_out(lr))
4743 |BOOST_PARAMETER_NAME|_\((_rrc, kw) in(rrc))
4744 |BOOST_PARAMETER_NAME|_\((_rr, kw) consume(rr))
4746 Use the macro as a substitute for a normal ``const`` function call operator
4747 header. Enclose the return type ``bool`` in parentheses. For each parameter,
4748 also enclose the expected value type in parentheses. Since the value types
4749 are mutually exclusive, you can wrap the parameters in a ``(deduced …)``
4750 clause. Otherwise, just as with a normal function, the order in which you
4751 specify the parameters determines their position. However, unlike a normal
4752 function, default values must be specified within the function body. Also
4753 within the function body, you must pass the matching identifier with the
4754 leading underscore to the bracket operator of ``args`` to extract the
4755 corresponding argument, but at least this doesn't require ``std::forward`` to
4756 preserve value categories.
4766 BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
4769 (lrc, (|std_bitset|_\<1>))
4770 (lr, (|std_bitset|_\<2>))
4773 (rrc, (|std_bitset|_\<3>))
4774 (rr, (|std_bitset|_\<4>))
4780 passed_by_lvalue_reference_to_const
4781 , U::evaluate_category<0>(args[_lrc])
4784 passed_by_lvalue_reference
4785 , U::evaluate_category<1>(args[_lr])
4788 passed_by_rvalue_reference_to_const
4789 , U::evaluate_category<2>(
4790 args[_rrc0 | rvalue_const_bitset<2>()]
4794 passed_by_rvalue_reference
4795 , U::evaluate_category<3>(
4796 args[_rr0 | rvalue_bitset<3>()]
4804 The following function calls are legal.
4809 b( // positional arguments
4810 lvalue_const_bitset<0>()
4811 , lvalue_bitset<1>()
4812 , rvalue_const_bitset<2>()
4813 , rvalue_bitset<3>()
4815 b( // positional arguments
4816 lvalue_const_bitset<0>()
4817 , lvalue_bitset<1>()
4819 b(( // composed arguments
4820 _rr0 = rvalue_bitset<3>()
4821 , _lrc0 = lvalue_const_bitset<0>()
4822 , _lr0 = lvalue_bitset<1>()
4823 , _rrc0 = rvalue_const_bitset<2>()
4825 b( // named arguments
4826 _rr0 = rvalue_bitset<3>()
4827 , _lrc0 = lvalue_const_bitset<0>()
4828 , _lr0 = lvalue_bitset<1>()
4829 , _rrc0 = rvalue_const_bitset<2>()
4831 b( // named arguments
4832 _lr0 = lvalue_bitset<1>()
4833 , _lrc0 = lvalue_const_bitset<0>()
4836 Because the parameters were wrapped in a ``(deduced …)`` clause, the following
4837 function calls are also legal.
4841 b( // deduced arguments
4843 , lvalue_const_bitset<0>()
4844 , lvalue_bitset<1>()
4845 , rvalue_const_bitset<2>()
4847 b( // deduced arguments
4849 , lvalue_const_bitset<0>()
4852 The |preprocessor_cpp|_ test program demonstrates proper usage of this macro.
4854 **Macro parameters:**
4856 * ``result`` is the parenthesized return type of the function call operator.
4857 * ``tag_namespace`` is the namespace in which the keywords used by the
4858 function call operator resides.
4859 * ``arguments`` is a |Boost_Preprocessor|_ `sequence`_ of
4860 *argument-specifiers*, as defined below.
4862 **Argument specifiers syntax:**
4866 argument-specifiers ::= *specifier-group0* {*specifier-group0*\ }
4868 specifier-group0 ::= *specifier-group1* |
4870 '**(**' '**deduced**'
4871 *specifier-group1* {*specifier-group1*\ }
4875 specifier-group1 ::=
4877 '**(**' '**optional**'
4878 *specifier* {*specifier*\ }
4881 '**(**' '**required**'
4882 *specifier* {*specifier*\ }
4887 '**(**' *argument-name* '**,**' *restriction* ')'
4890 ( '**\***' '**(**' *mfc* '**)**' ) |
4891 ( '**(**' *type-name* '**)**' ) |
4894 * ``argument-name`` is any valid C++ identifier.
4895 * ``mfc`` is an `MPL Binary Metafunction Class`_ whose first argument will
4896 be the type of the corresponding ``argument-name``, whose second argument
4897 will be the entire |ArgumentPack|_, and whose return type is a `Boolean
4898 Integral Constant`_; however, user code *cannot* compute ``mfc`` in terms
4899 of ``previous-name ## _type``.
4900 * ``type-name`` is either the name of a **target type** or an `MPL Binary
4901 Metafunction Class`_ whose first argument will be the type of the
4902 corresponding ``argument-name``, whose second argument will be the entire
4903 |ArgumentPack|_, and whose return type is the **target type**.
4905 Note that *specifier* does not include *default-value*. It is up to the
4906 function body to determine the default value of all optional arguments.
4908 **Approximate expansion:**
4912 * ``n`` denotes the *minimum* arity, as determined from ``arguments``.
4913 * ``m`` denotes the *maximum* arity, as determined from ``arguments``.
4917 // If **result** is a template instantiation of |boost_enable_if|_\,
4918 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
4919 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
4920 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
4921 // |std_enable_if|_\:
4922 template <typename Args>
4923 using boost_param_result_const\_ ## __LINE__ ## operator = **result**;
4925 // If **result** is a simple return type:
4926 template <typename Args>
4927 struct boost_param_result_const\_ ## __LINE__ ## operator
4929 typedef **result** type;
4932 struct boost_param_params_const\_ ## __LINE__ ## operator
4934 *list of parameter specifications, based on arguments*
4939 typedef boost_param_params_const\_ ## __LINE__ ## operator
4940 boost_param_parameters_const\_ ## __LINE__ ## operator;
4942 template <typename A0, …, typename A ## **n**>
4943 **result** operator()(
4944 A0&& a0, …, A ## **n**\ && a ## **n**
4945 , typename boost_param_parameters_const\_ ## __LINE__ ## operator
4946 ::match<A0, …, A ## **n**>::type
4947 = boost_param_parameters_const\_ ## __LINE__ ## operator()
4950 return this->boost_param_impl_const ## __LINE__ ## operator(
4951 boost_param_parameters_const\_ ## __LINE__ ## operator()(
4952 |std_forward|_\<A0>(a0)
4954 , |std_forward|_\<A ## **n**>(a ## **n**)
4961 template <typename A0, …, typename A ## **m**>
4962 **result** operator()(
4963 A0&& a0, …, A ## **m**\ && a ## **m**
4964 , typename boost_param_parameters_const\_ ## __LINE__ ## operator
4965 ::match<A0, …, A ## **m**>::type
4966 = boost_param_parameters_const\_ ## __LINE__ ## operator()
4969 return this->boost_param_impl_const ## __LINE__ ## operator(
4970 boost_param_parameters_const\_ ## __LINE__ ## operator()(
4971 |std_forward|_\<A0>(a0)
4973 , |std_forward|_\<A ## **m**>(a ## **m**)
4978 template <typename Args>
4979 typename boost_param_result_const\_ ## __LINE__ ## operator<Args>::type
4980 boost_param_impl_const ## __LINE__ ## operator(Args const& args) const
4982 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
4983 available for use within the function call operator body.
4985 .. |BOOST_PARAMETER_NO_SPEC_FUNCTION| replace:: ``BOOST_PARAMETER_NO_SPEC_FUNCTION``
4986 .. _BOOST_PARAMETER_NO_SPEC_FUNCTION:
4988 ``BOOST_PARAMETER_NO_SPEC_FUNCTION(result, name)``
4989 --------------------------------------------------
4991 :Defined in: |preprocessor_no_spec_header|_
4993 Generates a function that can take in named arguments.
4997 The return type of each of the following function templates falls under a
4998 different value category.
5002 template <std::size_t N>
5003 |std_bitset|_\<N + 1> rvalue_bitset()
5005 return |std_bitset|_\<N + 1>();
5008 template <std::size_t N>
5009 |std_bitset|_\<N + 1> const rvalue_const_bitset()
5011 return |std_bitset|_\<N + 1>();
5014 template <std::size_t N>
5015 |std_bitset|_\<N + 1>& lvalue_bitset()
5017 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
5021 template <std::size_t N>
5022 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
5024 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
5028 The ``U::evaluate_category`` static member function template has a simple job:
5029 to return the correct value category when passed in an object returned by one
5030 of the functions defined above. Assume that
5031 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
5037 passed_by_lvalue_reference_to_const
5038 , passed_by_lvalue_reference
5039 , passed_by_rvalue_reference_to_const
5040 , passed_by_rvalue_reference
5045 template <std::size_t N>
5046 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
5048 return passed_by_lvalue_reference_to_const;
5051 template <std::size_t N>
5052 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
5054 return passed_by_lvalue_reference;
5057 template <std::size_t N>
5058 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
5060 return passed_by_rvalue_reference_to_const;
5063 template <std::size_t N>
5064 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
5066 return passed_by_rvalue_reference;
5070 Named parameters are required when invoking the function; however, none of
5071 their tags need to be in the same namespace.
5075 |BOOST_PARAMETER_NAME|_\((_lrc, kw0) in(lrc))
5076 |BOOST_PARAMETER_NAME|_\((_lr, kw1) in_out(lr))
5077 |BOOST_PARAMETER_NAME|_\((_rrc, kw2) in(rrc))
5078 |BOOST_PARAMETER_NAME|_\((_rr, kw3) consume(rr))
5080 Use the macro as a substitute for a variadic function header. Enclose the
5081 return type ``bool`` in parentheses.
5085 BOOST_PARAMETER_NO_SPEC_FUNCTION((bool), evaluate)
5088 passed_by_lvalue_reference_to_const
5089 , U::evaluate_category<0>(args[_lrc])
5092 passed_by_lvalue_reference
5093 , U::evaluate_category<1>(args[_lr])
5096 passed_by_rvalue_reference_to_const
5097 , U::evaluate_category<2>(
5098 args[_rrc | rvalue_const_bitset<2>()]
5102 passed_by_rvalue_reference
5103 , U::evaluate_category<3>(args[_rr | rvalue_bitset<3>()])
5109 To invoke the function, bind all its arguments to named parameters.
5114 _rr0 = rvalue_bitset<3>()
5115 , _lrc0 = lvalue_const_bitset<0>()
5116 , _lr0 = lvalue_bitset<1>()
5117 , _rrc0 = rvalue_const_bitset<2>()
5120 _lr0 = lvalue_bitset<1>()
5121 , _lrc0 = lvalue_const_bitset<0>()
5124 The |preproc_eval_cat_no_spec_cpp|_ test program demonstrates proper usage of
5127 **Macro parameters:**
5129 * ``result`` is the parenthesized return type of the function.
5130 * ``name`` is the base name of the function; it determines the name of the
5131 generated implementation function.
5133 **Argument specifiers syntax:**
5137 **Approximate expansion:**
5141 // If **result** is a template instantiation of |boost_enable_if|_\,
5142 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
5143 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
5144 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
5145 // |std_enable_if|_\:
5146 template <typename TaggedArg0, typename ...TaggedArgs>
5147 using boost_param_no_spec_result\_ ## __LINE__ ## **name** = **result**;
5149 // If **result** is a simple return type:
5150 template <typename TaggedArg0, typename ...TaggedArgs>
5151 struct boost_param_no_spec_result\_ ## __LINE__ ## **name**
5153 typedef **result** type;
5156 template <typename ResultType, typename Args>
5158 boost_param_no_spec_impl ## __LINE__ ## **name**\ (
5163 template <typename TaggedArg0, typename ...TaggedArgs>
5164 inline typename |boost_lazy_enable_if|_\<
5165 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
5166 , boost_param_no_spec_result\_ ## __LINE__ ## **name**\ <
5171 **name**\ (TaggedArg0 const& arg0, TaggedArgs const&... args)
5173 return boost_param_no_spec_impl ## __LINE__ ## **name**\ (
5176 boost_param_no_spec_result\_ ## __LINE__ ## **name**\ <
5181 , |compose|_\(arg0, args...)
5185 template <typename ResultType, typename Args>
5187 boost_param_no_spec_impl ## __LINE__ ## **name**\ (
5192 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
5193 available for use within the function body.
5195 .. |BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION| replace:: ``BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION``
5196 .. _BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION:
5198 ``BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION(result, name)``
5199 ---------------------------------------------------------
5201 :Defined in: |preprocessor_no_spec_header|_
5203 Generates a member function that can take in named arguments.
5207 When designing a front-end class template whose back-end is configurable via
5208 parameterized inheritance, it can be useful to omit argument specifiers from
5209 a named-parameter member function so that the delegate member functions of the
5210 back-end classes can enforce their own specifications.
5214 template <typename B>
5221 BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION((void), initialize)
5223 this->initialize_impl(args);
5227 Named parameters are required when invoking the member function; however, none
5228 of their tags need to be in the same namespace.
5232 |BOOST_PARAMETER_NAME|_\(a0)
5233 |BOOST_PARAMETER_NAME|_\(a1)
5234 |BOOST_PARAMETER_NAME|_\(a2)
5236 For this example, each of the back-end class templates requires its own
5237 parameter to be present in the argument pack. In practice, such parameters
5238 should be optional, with default values.
5242 template <typename T>
5252 T const& get_a0() const
5258 template <typename ArgPack>
5259 void initialize_impl(ArgPack const& args)
5261 this->a0 = args[_a0];
5265 template <typename B, typename T>
5266 class backend1 : public B
5271 backend1() : B(), a1()
5275 T const& get_a1() const
5281 template <typename ArgPack>
5282 void initialize_impl(ArgPack const& args)
5284 B::initialize_impl(args);
5285 this->a1 = args[_a1];
5289 template <typename B, typename T>
5290 class backend2 : public B
5295 backend2() : B(), a2()
5299 T const& get_a2() const
5305 template <typename ArgPack>
5306 void initialize_impl(ArgPack const& args)
5308 B::initialize_impl(args);
5309 this->a2 = args[_a2];
5313 This example shows that while ``backend0`` must always be the root base class
5314 template and that ``frontend`` must always be the most derived class template,
5315 the other back-ends can be chained together in different orders.
5319 char const* p = "foo";
5321 backend2<backend1<backend0<char const*>, char>, int>
5324 backend1<backend2<backend0<char const*>, int>, char>
5326 composed_obj0.initialize(_a2 = 4, _a1 = ' ', _a0 = p);
5327 composed_obj1.initialize(_a0 = p, _a1 = ' ', _a2 = 4);
5328 BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
5329 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
5330 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
5332 The |parameterized_inheritance_cpp|_ and |preproc_eval_cat_no_spec_cpp|_ test
5333 programs demonstrate proper usage of this macro.
5335 **Macro parameters:**
5337 * ``result`` is the parenthesized return type of the function.
5338 * ``name`` is the base name of the function; it determines the name of the
5339 generated implementation function. ``name`` may be qualified by the
5340 ``static`` keyword to declare the member function and its helpers as not
5341 associated with any object of the enclosing type.
5343 **Argument specifiers syntax:**
5347 **Approximate expansion:**
5351 // If **result** is a template instantiation of |boost_enable_if|_\,
5352 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
5353 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
5354 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
5355 // |std_enable_if|_\:
5356 template <typename TaggedArg0, typename ...TaggedArgs>
5357 using boost_param_no_spec_result\_ ## __LINE__ ## **name** = **result**;
5359 // If **result** is a simple return type:
5360 template <typename TaggedArg0, typename ...TaggedArgs>
5361 struct boost_param_no_spec_result\_ ## __LINE__ ## **name**
5363 typedef **result** type;
5366 template <typename TaggedArg0, typename ...TaggedArgs>
5367 inline typename |boost_lazy_enable_if|_\<
5368 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
5369 , boost_param_no_spec_result\_ ## __LINE__ ## **name**\ <
5374 **name**\ (TaggedArg0 const& arg0, TaggedArgs const&... args)
5376 return this->boost_param_no_spec_impl ## __LINE__ ## **name**\ (
5379 boost_param_no_spec_result\_ ## __LINE__ ## **name**\ <
5384 , |compose|_\(arg0, args...)
5388 template <typename ResultType, typename Args>
5390 boost_param_no_spec_impl ## __LINE__ ## **name**\ (
5395 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
5396 available for use within the function body.
5398 .. |BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION| replace:: ``BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION``
5399 .. _BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION:
5401 ``BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION(result, name)``
5402 ---------------------------------------------------------------
5404 :Defined in: |preprocessor_no_spec_header|_
5406 Generates a member function that can take in named arguments.
5410 The return type of each of the following function templates falls under a
5411 different value category.
5415 template <std::size_t N>
5416 |std_bitset|_\<N + 1> rvalue_bitset()
5418 return |std_bitset|_\<N + 1>();
5421 template <std::size_t N>
5422 |std_bitset|_\<N + 1> const rvalue_const_bitset()
5424 return |std_bitset|_\<N + 1>();
5427 template <std::size_t N>
5428 |std_bitset|_\<N + 1>& lvalue_bitset()
5430 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
5434 template <std::size_t N>
5435 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
5437 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
5441 The ``U::evaluate_category`` static member function template has a simple job:
5442 to return the correct value category when passed in an object returned by one
5443 of the functions defined above. Assume that
5444 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
5450 passed_by_lvalue_reference_to_const
5451 , passed_by_lvalue_reference
5452 , passed_by_rvalue_reference_to_const
5453 , passed_by_rvalue_reference
5458 template <std::size_t N>
5459 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
5461 return passed_by_lvalue_reference_to_const;
5464 template <std::size_t N>
5465 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
5467 return passed_by_lvalue_reference;
5470 template <std::size_t N>
5471 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
5473 return passed_by_rvalue_reference_to_const;
5476 template <std::size_t N>
5477 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
5479 return passed_by_rvalue_reference;
5483 Named parameters are required when invoking the member function; however, none
5484 of their tags need to be in the same namespace.
5488 |BOOST_PARAMETER_NAME|_\((_lrc, kw0) in(lrc))
5489 |BOOST_PARAMETER_NAME|_\((_lr, kw1) in_out(lr))
5490 |BOOST_PARAMETER_NAME|_\((_rrc, kw2) in(rrc))
5491 |BOOST_PARAMETER_NAME|_\((_rr, kw3) consume(rr))
5493 Use the macro as a substitute for a variadic function header. Enclose the
5494 return type ``bool`` in parentheses. The macro will qualify the function with
5495 the ``const`` keyword.
5505 BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION((bool), evaluate_m)
5508 passed_by_lvalue_reference_to_const
5509 , U::evaluate_category<0>(args[_lrc])
5512 passed_by_lvalue_reference
5513 , U::evaluate_category<1>(args[_lr])
5516 passed_by_rvalue_reference_to_const
5517 , U::evaluate_category<2>(
5518 args[_rrc | rvalue_const_bitset<2>()]
5522 passed_by_rvalue_reference
5523 , U::evaluate_category<3>(
5524 args[_rr | rvalue_bitset<3>()]
5532 To invoke the member function, bind all its arguments to named parameters.
5538 _rr0 = rvalue_bitset<3>()
5539 , _lrc0 = lvalue_const_bitset<0>()
5540 , _lr0 = lvalue_bitset<1>()
5541 , _rrc0 = rvalue_const_bitset<2>()
5544 _lr0 = lvalue_bitset<1>()
5545 , _lrc0 = lvalue_const_bitset<0>()
5548 The |preproc_eval_cat_no_spec_cpp|_ test program demonstrates proper usage of
5551 **Macro parameters:**
5553 * ``result`` is the parenthesized return type of the function.
5554 * ``name`` is the base name of the function; it determines the name of the
5555 generated implementation function.
5557 **Argument specifiers syntax:**
5561 **Approximate expansion:**
5565 // If **result** is a template instantiation of |boost_enable_if|_\,
5566 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
5567 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
5568 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
5569 // |std_enable_if|_\:
5570 template <typename TaggedArg0, typename ...TaggedArgs>
5571 using boost_param_no_spec_result_const\_ ## __LINE__ ## **name** = **result**;
5573 // If **result** is a simple return type:
5574 template <typename TaggedArg0, typename ...TaggedArgs>
5575 struct boost_param_no_spec_result_const\_ ## __LINE__ ## **name**
5577 typedef **result** type;
5580 template <typename TaggedArg0, typename ...TaggedArgs>
5581 inline typename |boost_lazy_enable_if|_\<
5582 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
5583 , boost_param_no_spec_result_const\_ ## __LINE__ ## **name**\ <
5588 **name**\ (TaggedArg0 const& arg0, TaggedArgs const&... args) const
5590 return this->boost_param_no_spec_impl_const ## __LINE__ ## **name**\ (
5593 boost_param_no_spec_result_const\_ ## __LINE__ ## **name**\ <
5598 , |compose|_\(arg0, args...)
5602 template <typename ResultType, typename Args>
5604 boost_param_no_spec_impl_const ## __LINE__ ## **name**\ (
5609 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
5610 available for use within the function body.
5612 .. |BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR| replace:: ``BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR``
5613 .. _BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR:
5615 ``BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR(result)``
5616 ----------------------------------------------------------
5618 :Defined in: |preprocessor_no_spec_header|_
5620 Generates a function call operator that can take in named arguments.
5624 When designing a front-end class template whose back-end is configurable via
5625 parameterized inheritance, it can be useful to omit argument specifiers from
5626 a named-parameter function call operator so that the delegate member functions
5627 of the back-end classes can enforce their own specifications.
5631 template <typename B>
5638 BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR((void))
5640 this->initialize_impl(args);
5644 Named parameters are required when invoking the function call operator;
5645 however, none of their tags need to be in the same namespace.
5649 |BOOST_PARAMETER_NAME|_\(a0)
5650 |BOOST_PARAMETER_NAME|_\(a1)
5651 |BOOST_PARAMETER_NAME|_\(a2)
5653 For this example, each of the back-end class templates requires its own
5654 parameter to be present in the argument pack. In practice, such parameters
5655 should be optional, with default values.
5659 template <typename T>
5669 T const& get_a0() const
5675 template <typename ArgPack>
5676 void initialize_impl(ArgPack const& args)
5678 this->a0 = args[_a0];
5682 template <typename B, typename T>
5683 class backend1 : public B
5688 backend1() : B(), a1()
5692 T const& get_a1() const
5698 template <typename ArgPack>
5699 void initialize_impl(ArgPack const& args)
5701 B::initialize_impl(args);
5702 this->a1 = args[_a1];
5706 template <typename B, typename T>
5707 class backend2 : public B
5712 backend2() : B(), a2()
5716 T const& get_a2() const
5722 template <typename ArgPack>
5723 void initialize_impl(ArgPack const& args)
5725 B::initialize_impl(args);
5726 this->a2 = args[_a2];
5730 This example shows that while ``backend0`` must always be the root base class
5731 template and that ``frontend`` must always be the most derived class template,
5732 the other back-ends can be chained together in different orders.
5736 char const* p = "foo";
5738 backend2<backend1<backend0<char const*>, char>, int>
5741 backend1<backend2<backend0<char const*>, int>, char>
5743 composed_obj0(_a2 = 4, _a1 = ' ', _a0 = p);
5744 composed_obj1(_a0 = p, _a1 = ' ', _a2 = 4);
5745 BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
5746 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
5747 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
5749 The |parameterized_inheritance_cpp|_ and |preproc_eval_cat_no_spec_cpp|_ test
5750 programs demonstrate proper usage of this macro.
5752 **Macro parameters:**
5754 * ``result`` is the parenthesized return type of the function call operator.
5756 **Argument specifiers syntax:**
5760 **Approximate expansion:**
5764 // If **result** is a template instantiation of |boost_enable_if|_\,
5765 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
5766 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
5767 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
5768 // |std_enable_if|_\:
5769 template <typename TaggedArg0, typename ...TaggedArgs>
5770 using boost_param_no_spec_result\_ ## __LINE__ ## operator = **result**;
5772 // If **result** is a simple return type:
5773 template <typename TaggedArg0, typename ...TaggedArgs>
5774 struct boost_param_no_spec_result\_ ## __LINE__ ## operator
5776 typedef **result** type;
5779 template <typename TaggedArg0, typename ...TaggedArgs>
5780 inline typename |boost_lazy_enable_if|_\<
5781 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
5782 , boost_param_no_spec_result\_ ## __LINE__ ## operator<
5787 operator()(TaggedArg0 const& arg0, TaggedArgs const&... args)
5789 return this->boost_param_no_spec_impl ## __LINE__ ## operator(
5792 boost_param_no_spec_result\_ ## __LINE__ ## operator<
5797 , |compose|_\(arg0, args...)
5801 template <typename ResultType, typename Args>
5803 boost_param_no_spec_impl ## __LINE__ ## operator(
5808 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
5809 available for use within the function body.
5811 .. |BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR| replace:: ``BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR``
5812 .. _BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR:
5814 ``BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR(result)``
5815 ----------------------------------------------------------------
5817 :Defined in: |preprocessor_no_spec_header|_
5819 Generates a function call operator that can take in named arguments.
5823 The return type of each of the following function templates falls under a
5824 different value category.
5828 template <std::size_t N>
5829 |std_bitset|_\<N + 1> rvalue_bitset()
5831 return |std_bitset|_\<N + 1>();
5834 template <std::size_t N>
5835 |std_bitset|_\<N + 1> const rvalue_const_bitset()
5837 return |std_bitset|_\<N + 1>();
5840 template <std::size_t N>
5841 |std_bitset|_\<N + 1>& lvalue_bitset()
5843 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
5847 template <std::size_t N>
5848 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
5850 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
5854 The ``U::evaluate_category`` static member function template has a simple job:
5855 to return the correct value category when passed in an object returned by one
5856 of the functions defined above. Assume that
5857 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
5863 passed_by_lvalue_reference_to_const
5864 , passed_by_lvalue_reference
5865 , passed_by_rvalue_reference_to_const
5866 , passed_by_rvalue_reference
5871 template <std::size_t N>
5872 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
5874 return passed_by_lvalue_reference_to_const;
5877 template <std::size_t N>
5878 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
5880 return passed_by_lvalue_reference;
5883 template <std::size_t N>
5884 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
5886 return passed_by_rvalue_reference_to_const;
5889 template <std::size_t N>
5890 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
5892 return passed_by_rvalue_reference;
5896 Named parameters are required when invoking the function call operator;
5897 however, none of their tags need to be in the same namespace.
5901 |BOOST_PARAMETER_NAME|_\((_lrc, kw0) in(lrc))
5902 |BOOST_PARAMETER_NAME|_\((_lr, kw1) in_out(lr))
5903 |BOOST_PARAMETER_NAME|_\((_rrc, kw2) in(rrc))
5904 |BOOST_PARAMETER_NAME|_\((_rr, kw3) consume(rr))
5906 Use the macro as a substitute for a variadic function call operator
5907 header. Enclose the return type ``bool`` in parentheses. The macro will
5908 qualify the function with the ``const`` keyword.
5918 BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR((bool))
5921 passed_by_lvalue_reference_to_const
5922 , U::evaluate_category<0>(args[_lrc])
5925 passed_by_lvalue_reference
5926 , U::evaluate_category<1>(args[_lr])
5929 passed_by_rvalue_reference_to_const
5930 , U::evaluate_category<2>(
5931 args[_rrc | rvalue_const_bitset<2>()]
5935 passed_by_rvalue_reference
5936 , U::evaluate_category<3>(
5937 args[_rr | rvalue_bitset<3>()]
5945 To invoke the function call operator, bind all its arguments to named
5952 _rr0 = rvalue_bitset<3>()
5953 , _lrc0 = lvalue_const_bitset<0>()
5954 , _lr0 = lvalue_bitset<1>()
5955 , _rrc0 = rvalue_const_bitset<2>()
5958 _lr0 = lvalue_bitset<1>()
5959 , _lrc0 = lvalue_const_bitset<0>()
5962 The |preproc_eval_cat_no_spec_cpp|_ test program demonstrates proper usage of this
5965 **Macro parameters:**
5967 * ``result`` is the parenthesized return type of the function call operator.
5969 **Argument specifiers syntax:**
5973 **Approximate expansion:**
5977 // If **result** is a template instantiation of |boost_enable_if|_\,
5978 // |boost_enable_if_c|_\, |boost_lazy_enable_if|_\,
5979 // |boost_lazy_enable_if_c|_\, |boost_disable_if|_\, |boost_disable_if_c|_\,
5980 // |boost_lazy_disable_if|_\, |boost_lazy_disable_if_c|_\, or
5981 // |std_enable_if|_\:
5982 template <typename TaggedArg0, typename ...TaggedArgs>
5983 using boost_param_no_spec_result_const\_ ## __LINE__ ## operator = **result**;
5985 // If **result** is a simple return type:
5986 template <typename TaggedArg0, typename ...TaggedArgs>
5987 struct boost_param_no_spec_result_const\_ ## __LINE__ ## operator
5989 typedef **result** type;
5992 template <typename TaggedArg0, typename ...TaggedArgs>
5993 inline typename |boost_lazy_enable_if|_\<
5994 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
5995 , boost_param_no_spec_result_const\_ ## __LINE__ ## operator<
6001 TaggedArg0 const& arg0
6002 , TaggedArgs const&... args
6005 return this->boost_param_no_spec_impl_const ## __LINE__ ## operator(
6008 boost_param_no_spec_result_const\_ ## __LINE__ ## operator<
6013 , |compose|_\(arg0, args...)
6017 template <typename ResultType, typename Args>
6019 boost_param_no_spec_impl_const ## __LINE__ ## operator(
6024 Only the |ArgumentPack|_ type ``Args`` and its object instance ``args`` are
6025 available for use within the function body.
6027 .. |BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR| replace:: ``BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR``
6028 .. _BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR:
6030 ``BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(cls, impl)``
6031 --------------------------------------------------
6033 :Defined in: |preprocessor_no_spec_header|_
6035 Generates a constructor that can take in named arguments.
6039 When designing a front-end class template whose back-end is configurable via
6040 parameterized inheritance, it can be useful to omit argument specifiers from
6041 a named-parameter constructor so that the delegate constructors of the
6042 back-end classes can enforce their own specifications.
6046 template <typename B>
6049 BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(frontend, (B))
6052 Named parameters are required when invoking the constructor; however, none of
6053 their tags need to be in the same namespace.
6057 |BOOST_PARAMETER_NAME|_\(a0)
6058 |BOOST_PARAMETER_NAME|_\(a1)
6059 |BOOST_PARAMETER_NAME|_\(a2)
6061 For this example, each of the back-end class templates requires its own
6062 parameter to be present in the argument pack. In practice, such parameters
6063 should be optional, with default values.
6071 template <typename T>
6077 template <typename ArgPack>
6080 , typename |boost_enable_if|_\<
6081 |is_argument_pack|_\<ArgPack>
6083 >::type = _enabler()
6088 T const& get_a0() const
6094 template <typename B, typename T>
6095 class backend1 : public B
6100 template <typename ArgPack>
6103 , typename |boost_enable_if|_\<
6104 |is_argument_pack|_\<ArgPack>
6106 >::type = _enabler()
6107 ) : B(args), a1(args[_a1])
6111 T const& get_a1() const
6117 template <typename B, typename T>
6118 class backend2 : public B
6123 template <typename ArgPack>
6126 , typename |boost_enable_if|_\<
6127 |is_argument_pack|_\<ArgPack>
6129 >::type = _enabler()
6130 ) : B(args), a2(args[_a2])
6134 T const& get_a2() const
6140 This example shows that while ``backend0`` must always be the root base class
6141 template and that ``frontend`` must always be the most derived class template,
6142 the other back-ends can be chained together in different orders.
6146 char const* p = "foo";
6148 backend2<backend1<backend0<char const*>, char>, int>
6149 > composed_obj0(_a2 = 4, _a1 = ' ', _a0 = p);
6151 backend1<backend2<backend0<char const*>, int>, char>
6152 > composed_obj1(_a0 = p, _a1 = ' ', _a2 = 4);
6153 BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
6154 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
6155 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
6157 The |parameterized_inheritance_cpp|_ and |preproc_eval_cat_no_spec_cpp|_ test
6158 programs demonstrate proper usage of this macro.
6160 **Macro parameters:**
6162 * ``cls`` is the name of the enclosing class.
6163 * ``impl`` is the parenthesized implementation base class for ``cls``.
6165 **Argument specifiers syntax:**
6169 **Approximate expansion:**
6175 , typename ...TaggedArgs
6176 , typename = typename |boost_enable_if|_\<
6177 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
6180 inline explicit **cls**\ (
6181 TaggedArg0 const& arg0
6182 , TaggedArgs const&... args
6183 ) : **impl**\ (|compose|_\(arg0, args...))
6187 .. |BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR| replace:: ``BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR``
6188 .. _BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR:
6190 ``BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(cls, impl)``
6191 ----------------------------------------------------------
6193 :Defined in: |preprocessor_no_spec_header|_
6195 Generates a constructor that can take in named arguments.
6199 The return type of each of the following function templates falls under a
6200 different value category.
6204 template <std::size_t N>
6205 |std_bitset|_\<N + 1> rvalue_bitset()
6207 return |std_bitset|_\<N + 1>();
6210 template <std::size_t N>
6211 |std_bitset|_\<N + 1> const rvalue_const_bitset()
6213 return |std_bitset|_\<N + 1>();
6216 template <std::size_t N>
6217 |std_bitset|_\<N + 1>& lvalue_bitset()
6219 static |std_bitset|_\<N + 1> lset = |std_bitset|_\<N + 1>();
6223 template <std::size_t N>
6224 |std_bitset|_\<N + 1> const& lvalue_const_bitset()
6226 static |std_bitset|_\<N + 1> const clset = |std_bitset|_\<N + 1>();
6230 The ``U::evaluate_category`` static member function template has a simple job:
6231 to return the correct value category when passed in an object returned by one
6232 of the functions defined above. Assume that
6233 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined.
6239 passed_by_lvalue_reference_to_const
6240 , passed_by_lvalue_reference
6241 , passed_by_rvalue_reference_to_const
6242 , passed_by_rvalue_reference
6247 template <std::size_t N>
6248 static invoked evaluate_category(|std_bitset|_\<N + 1> const&)
6250 return passed_by_lvalue_reference_to_const;
6253 template <std::size_t N>
6254 static invoked evaluate_category(|std_bitset|_\<N + 1>&)
6256 return passed_by_lvalue_reference;
6259 template <std::size_t N>
6260 static invoked evaluate_category(|std_bitset|_\<N + 1> const&&)
6262 return passed_by_rvalue_reference_to_const;
6265 template <std::size_t N>
6266 static invoked evaluate_category(|std_bitset|_\<N + 1>&&)
6268 return passed_by_rvalue_reference;
6272 Named parameters are required when invoking the constructor; however, none of
6273 their tags need to be in the same namespace.
6277 |BOOST_PARAMETER_NAME|_\((_lrc, kw0) in(lrc))
6278 |BOOST_PARAMETER_NAME|_\((_lr, kw1) in_out(lr))
6279 |BOOST_PARAMETER_NAME|_\((_rrc, kw2) in(rrc))
6280 |BOOST_PARAMETER_NAME|_\((_rr, kw3) consume(rr))
6282 Unlike |BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR|_, this macro doesn't require a
6283 base class, only a delegate function to which the generated constructor can
6284 pass its |ArgumentPack|_.
6290 BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(D, D::_evaluate)
6293 template <typename Args>
6294 static bool _evaluate(Args const& args)
6297 passed_by_lvalue_reference_to_const
6298 , U::evaluate_category<0>(args[_lrc])
6301 passed_by_lvalue_reference
6302 , U::evaluate_category<1>(args[_lr])
6305 passed_by_rvalue_reference_to_const
6306 , U::evaluate_category<2>(
6307 args[_rrc | rvalue_const_bitset<2>()]
6311 passed_by_rvalue_reference
6312 , U::evaluate_category<3>(
6313 args[_rr | rvalue_bitset<3>()]
6321 To invoke the constructor, bind all its arguments to named parameters.
6326 _rr0 = rvalue_bitset<3>()
6327 , _lrc0 = lvalue_const_bitset<0>()
6328 , _lr0 = lvalue_bitset<1>()
6329 , _rrc0 = rvalue_const_bitset<2>()
6332 _lr0 = lvalue_bitset<1>()
6333 , _lrc0 = lvalue_const_bitset<0>()
6336 The |preproc_eval_cat_no_spec_cpp|_ test program demonstrates proper usage of
6339 **Macro parameters:**
6341 * ``cls`` is the name of the enclosing class.
6342 * ``func`` is a function that takes in the |ArgumentPack|_ that the
6343 generated constructor passes on.
6345 **Argument specifiers syntax:**
6349 **Approximate expansion:**
6355 , typename ...TaggedArgs
6356 , typename = typename |boost_enable_if|_\<
6357 |are_tagged_arguments|_\<TaggedArg0,TaggedArgs...>
6360 inline explicit **cls**\ (
6361 TaggedArg0 const& arg0
6362 , TaggedArgs const&... args
6365 **func**\ (|compose|_\(arg0, args...));
6368 .. |BOOST_PARAMETER_NAME| replace:: ``BOOST_PARAMETER_NAME``
6369 .. _BOOST_PARAMETER_NAME:
6371 ``BOOST_PARAMETER_NAME(name)``
6372 ------------------------------
6374 :Defined in: |name_header|_
6376 Declares a tag-type and keyword object.
6378 **If** *name* is of the form:
6382 (*object-name*, *namespace-name*) *qualifier*\ (*tag-name*)
6386 :Requires: *qualifier* is either ``in``, ``out``, ``in_out``, ``consume``,
6387 ``move_from``, or ``forward``.
6392 namespace *namespace-name* {
6396 static constexpr char const* keyword_name()
6398 return ## *tag-name*;
6401 typedef *unspecified* _;
6402 typedef *unspecified* _1;
6403 typedef boost::parameter::*qualifier* ## _reference qualifier;
6405 // The following definitions are available only when
6406 // |BOOST_PARAMETER_CAN_USE_MP11|_ is defined.
6408 template <typename ArgumentPack>
6409 using binding_fn = typename |binding|_\<
6414 template <typename ArgumentPack>
6415 using fn = typename |value_type|_\<ArgumentPack, *tag-name*>::type;
6419 |keyword|_\<*tag-namespace*::*tag-name*> const& *object-name*
6420 = |keyword|_\<*tag-namespace*::*tag-name*>::instance;
6422 **Else If** *name* is of the form:
6426 (*tag-name*, *namespace-name*) *object-name*
6430 Treats *name* as if it were of the form:
6434 (forward(*tag-name*), *namespace-name*) *object-name*
6436 **Else If** *name* is of the form:
6440 *qualifier*\ (*tag-name*)
6444 :Requires: *qualifier* is either ``in``, ``out``, ``in_out``, ``consume``,
6445 ``move_from``, or ``forward``.
6454 static constexpr char const* keyword_name()
6456 return ## *tag-name*;
6459 typedef *unspecified* _;
6460 typedef *unspecified* _1;
6461 typedef boost::parameter::*qualifier* ## _reference qualifier;
6463 // The following definitions are available only when
6464 // |BOOST_PARAMETER_CAN_USE_MP11|_ is defined.
6466 template <typename ArgumentPack>
6467 using binding_fn = typename |binding|_\<
6472 template <typename ArgumentPack>
6473 using fn = typename |value_type|_\<ArgumentPack, *tag-name*>::type;
6477 |keyword|_\<tag::*tag-name*> const& _ ## *tag-name*
6478 = |keyword|_\<tag::*tag-name*>::instance;
6482 Treats *name* as if it were of the form:
6488 .. |BOOST_PARAMETER_NESTED_KEYWORD| replace:: ``BOOST_PARAMETER_NESTED_KEYWORD``
6489 .. _BOOST_PARAMETER_NESTED_KEYWORD:
6491 ``BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)``
6492 --------------------------------------------------------------
6494 :Defined in: |nested_keyword_header|_
6496 Declares a tag-type, a keyword object, and an alias for that object nested in
6499 **If** *name* is of the form:
6503 *qualifier*\ (*tag-name*)
6507 :Requires: *qualifier* is either ``in``, ``out``, ``in_out``, ``consume``,
6508 ``move_from``, or ``forward``.
6518 static constexpr char const* keyword_name()
6520 return ## *tag-name* ## _;
6523 typedef *unspecified* _;
6524 typedef *unspecified* _1;
6525 typedef boost::parameter::*qualifier* ## _reference qualifier;
6526 static |keyword|_\<*tag-name*> const& *alias*;
6528 // The following definitions are available only when
6529 // |BOOST_PARAMETER_CAN_USE_MP11|_ is defined.
6531 template <typename ArgumentPack>
6532 using binding_fn = typename |binding|_\<
6537 template <typename ArgumentPack>
6538 using fn = typename |value_type|_\<ArgumentPack, *tag-name*>::type;
6541 |keyword|_\<*tag-name*> const& tag::*tag-name*::*alias*
6542 = |keyword|_\<*tag-name*>::instance;
6545 |keyword|_\<tag::*tag-name*> const& tag::*tag-name*::*name*
6546 = |keyword|_\<tag::*tag-name*>::instance;
6550 Treats *name* as if it were of the form:
6556 .. |BOOST_PARAMETER_TEMPLATE_KEYWORD| replace:: ``BOOST_PARAMETER_TEMPLATE_KEYWORD``
6557 .. _BOOST_PARAMETER_TEMPLATE_KEYWORD:
6559 ``BOOST_PARAMETER_TEMPLATE_KEYWORD(name)``
6560 ------------------------------------------
6562 :Defined in: |template_keyword_header|_
6563 :Included by: |name_header|_
6573 template <typename T>
6574 struct *name* : |template_keyword|_\<tag:: *name*, T>
6578 The |function_type_tpl_param_cpp|_ test program demonstrates proper usage of
6581 .. |BOOST_PARAMETER_FUN| replace:: ``BOOST_PARAMETER_FUN``
6582 .. _BOOST_PARAMETER_FUN:
6584 ``BOOST_PARAMETER_FUN(r, n, l, h, p)``
6585 --------------------------------------
6587 .. admonition:: Deprecated
6589 This macro has been deprecated in favor of
6590 ``BOOST_PARAMETER_FUNCTION``.
6592 Generates a sequence of `forwarding function`_ templates named
6593 ``n``, with arities ranging from ``l`` to ``h``, returning ``r``,
6594 and using ``p`` to control overload resolution and assign tags to
6595 positional arguments.
6597 :Defined in: |macros_header|_
6598 :Requires: ``l`` and ``h`` are nonnegative integer tokens
6599 such that ``l`` < ``h``
6604 template <typename A1, typename A2, …, typename A ## **l**>
6607 A1 && a1, A2 && a2, …, A ## **l** && a ## **l**
6608 , typename **p**::match<A1, A2, …, A ## **l**>::type p = **p**\ ()
6611 return **name**\ _with_named_params(
6613 |std_forward|_\<A1>(a1)
6614 , |std_forward|_\<A2>(a2)
6616 , |std_forward|_\<A ## **l**>(a ## **l**)
6625 , typename A ## **l**
6626 , typename A ## |BOOST_PP_INC|_\ (**l**)
6630 A1 && a1, A2 && a2, …, A ## **l** && a ## **l**
6631 , A ## |BOOST_PP_INC|_\ (**l**) const& a ## |BOOST_PP_INC|_\ (**l**)
6632 , typename **p**::match<
6633 A1, A2, …, A ## **l**, A ## |BOOST_PP_INC|_\ (**l**)
6634 >::type p = **p**\ ()
6637 return **name**\ _with_named_params(
6639 |std_forward|_\<A1>(a1)
6640 , |std_forward|_\<A2>(a2)
6642 , |std_forward|_\<A ## **l**>(a ## **l**)
6643 , |std_forward|_\<A ## |BOOST_PP_INC|_\ (**l**)>(
6644 a ## |BOOST_PP_INC|_\ (**l**)
6652 template <typename A1, typename A2, …, typename A ## **h**>
6655 A1 && a1, A2 && a2, …, A ## **h** && x ## **h**
6656 , typename **p**::match<A1, A2, …, A ## **h**>::type p = **p**\ ()
6659 return **name**\ _with_named_params(
6661 |std_forward|_\<A1>(a1)
6662 , |std_forward|_\<A2>(a2)
6664 , |std_forward|_\<A ## **h**>(a ## **h**)
6669 The |macros_cpp|_ and |macros_eval_cat_cpp|_ test programs demonstrate proper
6670 usage of this macro.
6672 .. |BOOST_PARAMETER_KEYWORD| replace:: ``BOOST_PARAMETER_KEYWORD``
6673 .. _BOOST_PARAMETER_KEYWORD:
6675 ``BOOST_PARAMETER_KEYWORD(n, k)``
6676 ---------------------------------
6678 .. admonition:: Deprecated
6680 This macro has been deprecated in favor of
6681 ``BOOST_PARAMETER_NAME``.
6683 Generates the declaration of a |keyword tag type| named ``k`` in
6684 namespace ``n`` and a corresponding |keyword object| definition in
6685 the enclosing namespace.
6687 :Defined in: |keyword_header|_
6696 static constexpr char const* keyword_name()
6701 typedef *unspecified* _;
6702 typedef *unspecified* _1;
6703 typedef boost::parameter::forward_reference qualifier;
6705 // The following definitions are available only when
6706 // |BOOST_PARAMETER_CAN_USE_MP11|_ is defined.
6708 template <typename ArgumentPack>
6709 using binding_fn = typename |binding|_\<
6714 template <typename ArgumentPack>
6715 using fn = typename |value_type|_\<ArgumentPack, *k*>::type;
6721 |keyword|_\<*n*::**k**> const& **k**
6722 = |keyword|_\<*n*::**k**>::instance;
6725 ``BOOST_PARAMETER_MATCH(p, a, x)``
6726 ----------------------------------
6728 Generates a defaulted parameter declaration for a `forwarding function`_.
6730 :Defined in: |match_header|_
6731 :Requires: ``a`` is a `Boost.Preprocessor sequence`__ of the form
6737 __ ../../../preprocessor/doc/data.html
6743 typename **p**::match<**A0**\ , **A1**\ , …, **A** ## *n*>::type
6746 Configuration Macros
6747 ====================
6749 .. |BOOST_PARAMETER_HAS_PERFECT_FORWARDING| replace:: ``BOOST_PARAMETER_HAS_PERFECT_FORWARDING``
6750 .. _BOOST_PARAMETER_HAS_PERFECT_FORWARDING:
6752 ``BOOST_PARAMETER_HAS_PERFECT_FORWARDING``
6753 ------------------------------------------
6755 Determines whether or not the library supports perfect forwarding, or the
6756 preservation of parameter value categories. Users can manually disable this
6757 macro by ``#defining`` the |BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING|_
6758 macro. Otherwise, the library will ``#define`` this macro if and only if it
6759 is not already defined, and if the configuration macros
6760 |BOOST_NO_FUNCTION_TEMPLATE_ORDERING|_, |BOOST_NO_SFINAE|_,
6761 |BOOST_NO_CXX11_RVALUE_REFERENCES|_, |BOOST_NO_CXX11_VARIADIC_TEMPLATES|_, and
6762 |BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS|_ are not already defined by
6765 :Defined in: |config_header|_
6767 .. |BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING| replace:: ``BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING``
6768 .. _BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING:
6770 ``BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING``
6771 ----------------------------------------------
6773 It may be necessary to test user code in case perfect forwarding support is
6774 unavailable. Users can ``#define`` this macro either in their project
6775 settings or before including any library header files. Doing so will leave
6776 both |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ and
6777 |BOOST_PARAMETER_CAN_USE_MP11|_ undefined.
6779 .. |BOOST_PARAMETER_CAN_USE_MP11| replace:: ``BOOST_PARAMETER_CAN_USE_MP11``
6780 .. _BOOST_PARAMETER_CAN_USE_MP11:
6782 ``BOOST_PARAMETER_CAN_USE_MP11``
6783 --------------------------------
6785 Determines whether or not the library can use |Boost_MP11|_, a C++11
6786 metaprogramming library. Users can manually disable this macro by
6787 ``#defining`` the |BOOST_PARAMETER_DISABLE_MP11_USAGE|_ macro or the
6788 |BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING|_ macro. Otherwise, the library
6789 will ``#define`` this macro if and only if it is not already defined, if
6790 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is defined, and if the configuration
6791 macros |BOOST_NO_CXX11_CONSTEXPR|_, |BOOST_NO_CXX11_DECLTYPE_N3276|_,
6792 |BOOST_NO_CXX11_AUTO_DECLARATIONS|_, |BOOST_NO_CXX11_TEMPLATE_ALIASES|_,
6793 |BOOST_NO_CXX11_STATIC_ASSERT|_, |BOOST_NO_CXX11_HDR_TYPE_TRAITS|_,
6794 |BOOST_NO_CXX11_HDR_INITIALIZER_LIST|_, and |BOOST_NO_CXX11_HDR_TUPLE|_
6795 are not already defined by |Boost_Config|_.
6797 .. Admonition:: Usage Note
6799 |Boost_MP11|_ and |Boost_MPL|_ are **not** mutually exclusive. It's
6800 perfectly acceptable to specify deduced parameters using both quoted
6801 metafunctions and metafunction classes, for example. See
6802 |evaluate_category_cpp|_.
6804 :Defined in: |config_header|_
6807 Given the following definitions:
6811 |BOOST_PARAMETER_NAME|_\(x)
6813 template <typename A0>
6814 typename |boost_enable_if|_\<|std_is_same|_\<int,A0>,int>::type
6815 sfinae(A0 const& a0)
6820 |Boost_MP11|_ allows deduced parameters to be defined more succinctly:
6824 template <typename T, typename Args>
6825 using predicate = |std_is_convertible|_\<T,char const*>;
6827 |BOOST_PARAMETER_FUNCTION|_\((int), sfinae, tag,
6831 , \*(|mp11_quote|_\<predicate>)
6832 , static_cast<char const*>(|std_nullptr|_\)
6841 Without |Boost_MP11|_, deduced parameter definitions tend to be more verbose:
6847 template <typename T, typename Args>
6850 |boost_is_convertible|_\<T,char const*>
6851 , |mpl_true|_\ // Still have to convert to a
6852 , |mpl_false|_\ // `Boolean Integral Constant`_.
6858 |BOOST_PARAMETER_FUNCTION|_\((int), sfinae, tag,
6863 , static_cast<char const*>(|std_nullptr|_\)
6872 Either way, the following assertions will succeed:
6876 assert(1 == sfinae());
6877 assert(1 == sfinae("foo"));
6878 assert(0 == sfinae(1));
6880 As another example, given the following declarations and definitions:
6884 |BOOST_PARAMETER_NAME|_\(x)
6885 |BOOST_PARAMETER_NAME|_\(y)
6887 template <typename E, typename Args>
6888 void check0(E const& e, Args const& args);
6890 template <typename P, typename E, typename ...Args>
6891 void check(E const& e, Args const&... args)
6893 check0(e, P()(args...));
6896 Argument packs qualify as |Boost_MP11|_-style lists containing
6897 |keyword tag type|\ s:
6901 template <typename Args>
6904 template <typename K>
6905 void operator()(K&&) const
6907 // K is one of tag\:\:x, tag\:\:y, etc.
6911 template <typename E, typename Args>
6912 void check0(E const& e, Args const& args)
6914 boost::mp11::mp_for_each<E>(some_functor<Args>());
6917 The first check determines whether or not the argument type of ``_y`` is the
6918 same as the reference type of ``_x``, while the second check determines
6919 whether or not the argument type of ``_y`` is convertible to the value type of
6920 ``_x``. Here, it's possible to access the reference and value result types of
6921 indexing an argument pack a little more directly:
6925 // Use mp_bind on tag\:\:x\:\:binding_fn to access the reference type of _x.
6930 |deduced|_\<tag\:\:y>
6932 |std_is_same|_\ // |boost_is_same|_, standard version.
6933 , |mp11_1|_\ // will be bound to the argument type of _y.
6935 tag\:\:x\:\:binding_fn
6936 , |mp11_2|_\ // will be bound to the argument pack type.
6941 >((_x = 0, _y = 1), 0, 1);
6943 // Use mp_bind_q on tag\:\:x to access the value type of _x.
6948 |deduced|_\<tag\:\:y>
6950 |std_is_convertible|_\ // |boost_is_convertible|_, standard version.
6951 , |mp11_1|_\ // will be bound to the argument type of _y.
6954 , |mp11_2|_\ // will be bound to the argument pack type.
6959 >((_x = 0U, _y = 1U), 0U, 1U);
6961 Argument packs still qualify as |Boost_MPL|_-style lists containing
6962 |keyword tag type|\ s:
6966 template <typename Args>
6969 template <typename K>
6970 void operator()(K) const
6972 // K is one of tag\:\:x, tag\:\:y, etc.
6976 template <typename E, typename Args>
6977 void check0(E const& e, Args const& args)
6979 boost::mpl::for_each<E>(some_functor<Args>());
6982 However, without |Boost_MP11|_, the corresponding checks become a little more
6991 |deduced|_\<tag\:\:y>
6994 |boost_add_lvalue_reference|_\<|mp11_1|_\>
6995 , |binding|_\<|mp11_2|_\, tag\:\:x>
6997 , |mpl_true|_\ // Still have to convert to a
6998 , |mpl_false|_\ // `Boolean Integral Constant`_.
7002 >((_x = 0, _y = 1), 0, 1);
7004 // Use tag\:\:x\:\:_ or tag\:\:x\:\:_1 to access the value type of _x.
7009 |deduced|_\<tag\:\:y>
7011 |boost_is_convertible|_\<|mp11_1|_\, tag\:\:x\:\:_1>
7012 , |mpl_true|_\ // Still have to convert to a
7013 , |mpl_false|_\ // `Boolean Integral Constant`_.
7017 >((_x = 0U, _y = 1U), 0U, 1U);
7019 The |singular_cpp|_, |compose_cpp|_, |optional_deduced_sfinae_cpp|_, and
7020 |deduced_dep_pred_cpp|_ test programs demonstrate proper usage of this
7023 .. |BOOST_PARAMETER_DISABLE_MP11_USAGE| replace:: ``BOOST_PARAMETER_DISABLE_MP11_USAGE``
7024 .. _BOOST_PARAMETER_DISABLE_MP11_USAGE:
7026 ``BOOST_PARAMETER_DISABLE_MP11_USAGE``
7027 --------------------------------------
7029 It may be necessary to disable usage of |Boost_MP11|_ for compilers that
7030 cannot support it. Users can ``#define`` this macro either in their project
7031 settings or before including any library header files. Doing so will leave
7032 |BOOST_PARAMETER_CAN_USE_MP11|_ undefined.
7034 .. |BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE| replace:: ``BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE``
7035 .. _BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE:
7037 ``BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE``
7038 -----------------------------------------
7040 If |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is ``#defined``, then determines
7041 the `MPL Variadic Sequence`_ underlying the nested ``parameter_spec`` type of
7042 |parameters|. If the user does not manually ``#define`` this macro, then the
7043 library will ``#define`` it as |mp11_list|_ if
7044 |BOOST_PARAMETER_CAN_USE_MP11|_ is defined, |fusion_list|_ if
7045 |BOOST_FUSION_HAS_VARIADIC_LIST|_ is defined (by |Boost_Fusion|_),
7046 |fusion_deque|_ if |BOOST_FUSION_HAS_VARIADIC_DEQUE|_ is defined
7047 (by |Boost_Fusion|_), or |mpl_vector|_ otherwise.
7053 #define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE |fusion_vector|_
7055 :Defined in: |parameters_header|_
7057 .. |BOOST_PARAMETER_MAX_ARITY| replace:: ``BOOST_PARAMETER_MAX_ARITY``
7058 .. _BOOST_PARAMETER_MAX_ARITY:
7060 ``BOOST_PARAMETER_MAX_ARITY``
7061 -----------------------------
7063 If |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is ``#defined``, then:
7065 * If the `MPL Variadic Sequence`_ underlying the nested ``parameter_spec``
7066 type of |parameters| does not have a size limit--which is the case with
7067 |mp11_list|_, |fusion_list|_, and |fusion_deque|_, but not
7068 |mpl_vector|_--then this macro can be safely ignored. User code that
7069 manually defines |BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE|_ should also
7070 manually define this macro to the size limit of the sequence if it has
7073 If |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is **not** ``#defined``, then:
7075 * Mutable references must be wrapped by |boost_ref|_ or |std_ref|_ if passed
7076 by position to Boost.Parameter-enabled functions with arity greater than
7077 or equal to |BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY|_.
7079 :Defined in: |config_header|_
7080 :Default Value: |BOOST_MPL_LIMIT_VECTOR_SIZE|_ (defined by |Boost_MPL|_) if
7081 perfect forwarding is supported, ``8`` otherwise.
7082 :Minimum Value: ``2``
7083 :Maximum Value: |BOOST_PARAMETER_COMPOSE_MAX_ARITY|_
7085 .. |BOOST_PARAMETER_COMPOSE_MAX_ARITY| replace:: ``BOOST_PARAMETER_COMPOSE_MAX_ARITY``
7086 .. _BOOST_PARAMETER_COMPOSE_MAX_ARITY:
7088 ``BOOST_PARAMETER_COMPOSE_MAX_ARITY``
7089 -------------------------------------
7091 If |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is **not** ``#defined``, then
7092 determines the maximum number of arguments supported by the |compose| function
7093 and by the |BOOST_PARAMETER_NO_SPEC_FUNCTION|_,
7094 |BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION|_,
7095 |BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION|_,
7096 |BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR|_,
7097 |BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR|_,
7098 |BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR|_, and
7099 |BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR|_ code generation macros.
7101 :Defined in: |config_header|_
7102 :Default Value: ``20`` for a few older compilers, ``64`` otherwise
7103 :Minimum Value: ``2``
7105 .. |BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY| replace:: ``BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY``
7106 .. _BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY:
7108 ``BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY``
7109 --------------------------------------------------------
7111 If this library does **not** support perfect forwarding, determines the number
7112 of arguments less than which |parameters| generates an exponential number of
7113 function call operator overloads, and greater than or equal to which
7114 |parameters| does not. Will only be ``#defined`` by the library if it is
7115 not already ``#defined`` and |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ is
7116 **not** ``#defined``.
7118 :Defined in: |config_header|_
7119 :Default Value: ``0``
7120 :Minimum Value: ``0``
7122 ...Outside Of This Library
7123 --------------------------
7125 #. If |Boost_Config|_ defines the macro
7126 |BOOST_NO_FUNCTION_TEMPLATE_ORDERING|_, then the macros
7127 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ and
7128 |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined; otherwise, the
7129 code generation macros would not work correctly.
7130 #. If |Boost_Config|_ defines the macro |BOOST_NO_SFINAE|_, then the macros
7131 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ and
7132 |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined; otherwise, keyword
7133 types generated by |BOOST_PARAMETER_NAME|_ and
7134 |BOOST_PARAMETER_NESTED_KEYWORD|_ would not work correctly.
7135 #. If |Boost_Config|_ defines the macro
7136 |BOOST_NO_CXX11_RVALUE_REFERENCES|_, then the macros
7137 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ and
7138 |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7139 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_VARIADIC_TEMPLATES|_,
7140 then the macros |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ and
7141 |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7142 #. If |Boost_Config|_ defines the macro
7143 |BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS|_, then the macros
7144 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_ and
7145 |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7146 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_CONSTEXPR|_, then the
7147 macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7148 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_DECLTYPE_N3276|_,
7149 then the macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7150 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_AUTO_DECLARATIONS|_,
7151 then the macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7152 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_TEMPLATE_ALIASES|_,
7153 then the macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7154 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_STATIC_ASSERT|_, then
7155 the macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7156 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_HDR_TYPE_TRAITS|_,
7157 then the macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7158 #. If |Boost_Config|_ defines the macro
7159 |BOOST_NO_CXX11_HDR_INITIALIZER_LIST|_, then the macro
7160 |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7161 #. If |Boost_Config|_ defines the macro |BOOST_NO_CXX11_HDR_TUPLE|_, then the
7162 macro |BOOST_PARAMETER_CAN_USE_MP11|_ will be left undefined.
7163 #. If |Boost_Fusion|_ defines the macro |BOOST_FUSION_HAS_VARIADIC_LIST|_,
7164 if this library defines the macro
7165 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_, and if
7166 |BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE|_ is left undefined, then the
7167 `MPL Variadic Sequence`_ underlying the nested ``parameter_spec`` type of
7168 |parameters| will be |fusion_list|_.
7169 #. If |Boost_Fusion|_ defines the macro |BOOST_FUSION_HAS_VARIADIC_DEQUE|_,
7170 if this library defines the macro
7171 |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_, and if
7172 |BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE|_ is left undefined, then the
7173 `MPL Variadic Sequence`_ underlying the nested ``parameter_spec`` type of
7174 |parameters| will be |fusion_deque|_.
7175 #. The value that |Boost_MPL|_ defines the macro
7176 |BOOST_MPL_LIMIT_VECTOR_SIZE|_ as will be the value that this library
7177 defines the macro |BOOST_PARAMETER_MAX_ARITY|_ as if this library defines
7178 the macro |BOOST_PARAMETER_HAS_PERFECT_FORWARDING|_.
7183 Follow `this link`__ to the Boost.Parameter tutorial documentation.
7185 __ index.html#tutorial
7187 //////////////////////////////////////////////////////////////////////////////
7189 .. [#thread] References to tag objects may be initialized multiple
7190 times. This scenario can only occur in the presence of
7191 threading. Because the C++ standard doesn't consider threading,
7192 it doesn't explicitly allow or forbid multiple initialization of
7193 references. That said, it's hard to imagine an implementation
7194 where it could make a difference.
7196 .. [#no_result_of] Where |BOOST_NO_RESULT_OF|_ is ``#defined``,
7197 |boost_result_of|_\ ``<F()>::type`` is replaced by ``F::result_type``.
7199 .. |std_nullptr| replace:: std::nullptr
7200 .. _std_nullptr: http://en.cppreference.com/w/cpp/language/nullptr
7201 .. |std_forward| replace:: std::forward
7202 .. _std_forward: http://en.cppreference.com/w/cpp/utility/forward
7203 .. |std_enable_if| replace:: std::enable_if
7204 .. _std_enable_if: http://en.cppreference.com/w/cpp/types/enable_if
7205 .. |std_is_convertible| replace:: std::is_convertible
7206 .. _std_is_convertible: http://en.cppreference.com/w/cpp/types/is_convertible
7207 .. |std_is_same| replace:: std::is_same
7208 .. _std_is_same: http://en.cppreference.com/w/cpp/types/is_same
7209 .. |std_ref| replace:: ``std::ref``
7210 .. _std_ref: http://en.cppreference.com/w/cpp/utility/functional/ref
7211 .. |std_map| replace:: std::map
7212 .. _std_map: http://en.cppreference.com/w/cpp/container/map
7213 .. |std_string| replace:: std::string
7214 .. _std_string: http://en.cppreference.com/w/cpp/string/basic_string
7215 .. |std_bitset| replace:: std::bitset
7216 .. _std_bitset: http://en.cppreference.com/w/cpp/utility/bitset
7217 .. |Boost_Config| replace:: Boost.Config
7218 .. _Boost_Config: ../../../config/doc/html/index.html
7219 .. |BOOST_NO_FUNCTION_TEMPLATE_ORDERING| replace:: ``BOOST_NO_FUNCTION_TEMPLATE_ORDERING``
7220 .. _BOOST_NO_FUNCTION_TEMPLATE_ORDERING: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects
7221 .. |BOOST_NO_SFINAE| replace:: ``BOOST_NO_SFINAE``
7222 .. _BOOST_NO_SFINAE: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects
7223 .. |BOOST_NO_CXX11_AUTO_DECLARATIONS| replace:: ``BOOST_NO_CXX11_AUTO_DECLARATIONS``
7224 .. _BOOST_NO_CXX11_AUTO_DECLARATIONS: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7225 .. |BOOST_NO_CXX11_CONSTEXPR| replace:: ``BOOST_NO_CXX11_CONSTEXPR``
7226 .. _BOOST_NO_CXX11_CONSTEXPR: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7227 .. |BOOST_NO_CXX11_DECLTYPE_N3276| replace:: ``BOOST_NO_CXX11_DECLTYPE_N3276``
7228 .. _BOOST_NO_CXX11_DECLTYPE_N3276: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7229 .. |BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS| replace:: ``BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS``
7230 .. _BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7231 .. |BOOST_NO_CXX11_HDR_INITIALIZER_LIST| replace:: ``BOOST_NO_CXX11_HDR_INITIALIZER_LIST``
7232 .. _BOOST_NO_CXX11_HDR_INITIALIZER_LIST: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7233 .. |BOOST_NO_CXX11_HDR_TUPLE| replace:: ``BOOST_NO_CXX11_HDR_TUPLE``
7234 .. _BOOST_NO_CXX11_HDR_TUPLE: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7235 .. |BOOST_NO_CXX11_HDR_TYPE_TRAITS| replace:: ``BOOST_NO_CXX11_HDR_TYPE_TRAITS``
7236 .. _BOOST_NO_CXX11_HDR_TYPE_TRAITS: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7237 .. |BOOST_NO_CXX11_RVALUE_REFERENCES| replace:: ``BOOST_NO_CXX11_RVALUE_REFERENCES``
7238 .. _BOOST_NO_CXX11_RVALUE_REFERENCES: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7239 .. |BOOST_NO_CXX11_STATIC_ASSERT| replace:: ``BOOST_NO_CXX11_STATIC_ASSERT``
7240 .. _BOOST_NO_CXX11_STATIC_ASSERT: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7241 .. |BOOST_NO_CXX11_TEMPLATE_ALIASES| replace:: ``BOOST_NO_CXX11_TEMPLATE_ALIASES``
7242 .. _BOOST_NO_CXX11_TEMPLATE_ALIASES: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7243 .. |BOOST_NO_CXX11_VARIADIC_TEMPLATES| replace:: ``BOOST_NO_CXX11_VARIADIC_TEMPLATES``
7244 .. _BOOST_NO_CXX11_VARIADIC_TEMPLATES: ../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported
7245 .. |Boost_Preprocessor| replace:: Boost.Preprocessor
7246 .. _Boost_Preprocessor: ../../../preprocessor/doc/index.html
7247 .. _`sequence`: ../../../preprocessor/doc/data/sequences.html
7248 .. |BOOST_PP_INC| replace:: BOOST_PP_INC
7249 .. _BOOST_PP_INC: ../../../preprocessor/doc/ref/inc.html
7250 .. |boost_enable_if| replace:: boost::enable_if
7251 .. _boost_enable_if: ../../../core/doc/html/core/enable_if.html
7252 .. |boost_enable_if_c| replace:: boost::enable_if_c
7253 .. _boost_enable_if_c: ../../../core/doc/html/core/enable_if.html
7254 .. |boost_lazy_enable_if| replace:: boost::lazy_enable_if
7255 .. _boost_lazy_enable_if: ../../../core/doc/html/core/enable_if.html
7256 .. |boost_lazy_enable_if_c| replace:: boost::lazy_enable_if_c
7257 .. _boost_lazy_enable_if_c: ../../../core/doc/html/core/enable_if.html
7258 .. |boost_disable_if| replace:: boost::disable_if
7259 .. _boost_disable_if: ../../../core/doc/html/core/enable_if.html
7260 .. |boost_disable_if_c| replace:: boost::disable_if_c
7261 .. _boost_disable_if_c: ../../../core/doc/html/core/enable_if.html
7262 .. |boost_lazy_disable_if| replace:: boost::lazy_disable_if
7263 .. _boost_lazy_disable_if: ../../../core/doc/html/core/enable_if.html
7264 .. |boost_lazy_disable_if_c| replace:: boost::lazy_disable_if_c
7265 .. _boost_lazy_disable_if_c: ../../../core/doc/html/core/enable_if.html
7266 .. |boost_ref| replace:: ``boost::ref``
7267 .. _boost_ref: ../../../core/doc/html/core/ref.html
7268 .. |BOOST_NO_RESULT_OF| replace:: ``BOOST_NO_RESULT_OF``
7269 .. _BOOST_NO_RESULT_OF: ../../../utility/utility.htm#BOOST_NO_RESULT_OF
7270 .. |boost_result_of| replace:: ``boost::result_of``
7271 .. _boost_result_of: ../../../utility/utility.htm#result_of
7272 .. |boost_is_const| replace:: boost::is_const
7273 .. _boost_is_const: ../../../type_traits/doc/html/boost_typetraits/is_const.html
7274 .. |boost_is_convertible| replace:: boost::is_convertible
7275 .. _boost_is_convertible: ../../../type_traits/doc/html/boost_typetraits/is_convertible.html
7276 .. |boost_is_same| replace:: boost::is_same
7277 .. _boost_is_same: ../../../type_traits/doc/html/boost_typetraits/is_same.html
7278 .. |boost_is_scalar| replace:: boost::is_scalar
7279 .. _boost_is_scalar: ../../../type_traits/doc/html/boost_typetraits/is_scalar.html
7280 .. |boost_add_lvalue_reference| replace:: boost::add_lvalue_reference
7281 .. _boost_add_lvalue_reference: ../../../type_traits/doc/html/boost_typetraits/add_lvalue_reference.html
7282 .. |boost_remove_reference| replace:: boost::remove_reference
7283 .. _boost_remove_reference: ../../../type_traits/doc/html/boost_typetraits/remove_reference.html
7284 .. |Boost_MPL| replace:: Boost.MPL
7285 .. _Boost_MPL: ../../../mpl/doc/index.html
7286 .. _`Metafunction`: ../../../mpl/doc/refmanual/metafunction.html
7287 .. _`Boolean Integral Constant`: ../../../mpl/doc/refmanual/integral-constant.html
7288 .. _`MPL Binary Metafunction Class`: ../../../mpl/doc/refmanual/metafunction-class.html
7289 .. _`MPL Forward Sequence`: ../../../mpl/doc/refmanual/forward-sequence.html
7290 .. _`MPL Associative Sequence`: ../../../mpl/doc/refmanual/associative-sequence.html
7291 .. _`MPL Variadic Sequence`: ../../../mpl/doc/refmanual/variadic-sequence.html
7292 .. |BOOST_MPL_LIMIT_VECTOR_SIZE| replace:: ``BOOST_MPL_LIMIT_VECTOR_SIZE``
7293 .. _BOOST_MPL_LIMIT_VECTOR_SIZE: ../../../mpl/doc/refmanual/limit-vector-size.html
7294 .. |mpl_eval_if| replace:: boost::mpl::eval_if
7295 .. _mpl_eval_if: ../../../mpl/doc/refmanual/eval-if.html
7296 .. |mpl_true| replace:: mpl::true\_
7297 .. _mpl_true: ../../../mpl/doc/refmanual/bool.html
7298 .. |mpl_false| replace:: mpl::false\_
7299 .. _mpl_false: ../../../mpl/doc/refmanual/bool.html
7300 .. |mpl_if| replace:: mpl::if\_
7301 .. _mpl_if: ../../../mpl/doc/refmanual/if.html
7302 .. |mpl_vector| replace:: ``boost::mpl::vector``
7303 .. _mpl_vector: ../../../mpl/doc/refmanual/vector.html
7304 .. |Boost_MP11| replace:: Boost.MP11
7305 .. _Boost_MP11: ../../../mp11/doc/html/mp11.html
7306 .. |mp11_quote| replace:: boost::mp11::mp_quote
7307 .. _mp11_quote: ../../../mp11/doc/html/mp11.html#mp_quotef
7308 .. |mp11_1| replace:: boost::mp11::_1
7309 .. _mp11_1: ../../../mp11/doc/html/mp11.html#1_9
7310 .. |mp11_2| replace:: boost::mp11::_2
7311 .. _mp11_2: ../../../mp11/doc/html/mp11.html#1_9
7312 .. |mp11_bind| replace:: boost::mp11::mp_bind
7313 .. _mp11_bind: ../../../mp11/doc/html/mp11.html#mp_bindf_t
7314 .. |mp11_bind_q| replace:: boost::mp11::mp_bind_q
7315 .. _mp11_bind_q: ../../../mp11/doc/html/mp11.html#mp_bind_qq_t
7316 .. |mp11_list| replace:: ``boost::mp11::mp_list``
7317 .. _mp11_list: ../../../mp11/doc/html/mp11.html#mp_listt
7318 .. |Boost_Fusion| replace:: Boost.Fusion
7319 .. _Boost_Fusion: ../../../fusion/doc/html/index.html
7320 .. |BOOST_FUSION_HAS_VARIADIC_DEQUE| replace:: ``BOOST_FUSION_HAS_VARIADIC_DEQUE``
7321 .. _BOOST_FUSION_HAS_VARIADIC_DEQUE: ../../../../boost/fusion/container/deque/deque_fwd.hpp
7322 .. |BOOST_FUSION_HAS_VARIADIC_LIST| replace:: ``BOOST_FUSION_HAS_VARIADIC_LIST``
7323 .. _BOOST_FUSION_HAS_VARIADIC_LIST: ../../../../boost/fusion/container/list/list_fwd.hpp
7324 .. |fusion_vector| replace:: ``boost::fusion::vector``
7325 .. _fusion_vector: ../../../fusion/doc/html/fusion/container/vector.html
7326 .. |fusion_deque| replace:: ``boost::fusion::deque``
7327 .. _fusion_deque: ../../../fusion/doc/html/fusion/container/deque.html
7328 .. |fusion_list| replace:: ``boost::fusion::list``
7329 .. _fusion_list: ../../../fusion/doc/html/fusion/container/list.html
7330 .. |config_header| replace:: boost/parameter/config.hpp
7331 .. _config_header: ../../../../boost/parameter/config.hpp
7332 .. |binding_header| replace:: boost/parameter/binding.hpp
7333 .. _binding_header: ../../../../boost/parameter/binding.hpp
7334 .. |value_type_header| replace:: boost/parameter/value_type.hpp
7335 .. _value_type_header: ../../../../boost/parameter/value_type.hpp
7336 .. |are_tagged_arguments_header| replace:: boost/parameter/are_tagged_arguments.hpp
7337 .. _are_tagged_arguments_header: ../../../../boost/parameter/are_tagged_arguments.hpp
7338 .. |is_argument_pack_header| replace:: boost/parameter/is_argument_pack.hpp
7339 .. _is_argument_pack_header: ../../../../boost/parameter/is_argument_pack.hpp
7340 .. |template_keyword_header| replace:: boost/parameter/template_keyword.hpp
7341 .. _template_keyword_header: ../../../../boost/parameter/template_keyword.hpp
7342 .. |keyword_header| replace:: boost/parameter/keyword.hpp
7343 .. _keyword_header: ../../../../boost/parameter/keyword.hpp
7344 .. |name_header| replace:: boost/parameter/name.hpp
7345 .. _name_header: ../../../../boost/parameter/name.hpp
7346 .. |nested_keyword_header| replace:: boost/parameter/nested_keyword.hpp
7347 .. _nested_keyword_header: ../../../../boost/parameter/nested_keyword.hpp
7348 .. |compose_header| replace:: boost/parameter/compose.hpp
7349 .. _compose_header: ../../../../boost/parameter/compose.hpp
7350 .. |preprocessor_no_spec_header| replace:: boost/parameter/preprocessor_no_spec.hpp
7351 .. _preprocessor_no_spec_header: ../../../../boost/parameter/preprocessor_no_spec.hpp
7352 .. |required_header| replace:: boost/parameter/required.hpp
7353 .. _required_header: ../../../../boost/parameter/required.hpp
7354 .. |optional_header| replace:: boost/parameter/optional.hpp
7355 .. _optional_header: ../../../../boost/parameter/optional.hpp
7356 .. |deduced_header| replace:: boost/parameter/deduced.hpp
7357 .. _deduced_header: ../../../../boost/parameter/deduced.hpp
7358 .. |parameters_header| replace:: boost/parameter/parameters.hpp
7359 .. _parameters_header: ../../../../boost/parameter/parameters.hpp
7360 .. |match_header| replace:: boost/parameter/match.hpp
7361 .. _match_header: ../../../../boost/parameter/match.hpp
7362 .. |macros_header| replace:: boost/parameter/macros.hpp
7363 .. _macros_header: ../../../../boost/parameter/macros.hpp
7364 .. |preprocessor_header| replace:: boost/parameter/preprocessor.hpp
7365 .. _preprocessor_header: ../../../../boost/parameter/preprocessor.hpp
7366 .. |function_type_tpl_param_cpp| replace:: function_type_tpl_param.cpp
7367 .. _function_type_tpl_param_cpp: ../../test/function_type_tpl_param.cpp
7368 .. |ntp_cpp| replace:: test/ntp.cpp
7369 .. _ntp_cpp: ../../test/ntp.cpp
7370 .. |singular_cpp| replace:: singular.cpp
7371 .. _singular_cpp: ../../test/singular.cpp
7372 .. |compose_cpp| replace:: compose.cpp
7373 .. _compose_cpp: ../../test/compose.cpp
7374 .. |evaluate_category_cpp| replace:: evaluate_category.cpp
7375 .. _evaluate_category_cpp: ../../test/evaluate_category.cpp
7376 .. |parameterized_inheritance_cpp| replace:: parameterized_inheritance.cpp
7377 .. _parameterized_inheritance_cpp: ../../test/parameterized_inheritance.cpp
7378 .. |preproc_eval_cat_no_spec_cpp| replace:: preprocessor_eval_cat_no_spec.cpp
7379 .. _preproc_eval_cat_no_spec_cpp: ../../test/preprocessor_eval_cat_no_spec.cpp
7380 .. |preprocessor_eval_cat_cpp| replace:: preprocessor_eval_category.cpp
7381 .. _preprocessor_eval_cat_cpp: ../../test/preprocessor_eval_category.cpp
7382 .. |preprocessor_eval_cat_8_cpp| replace:: preprocessor_eval_cat_8.cpp
7383 .. _preprocessor_eval_cat_8_cpp: ../../test/preprocessor_eval_cat_8.cpp
7384 .. |optional_deduced_sfinae_cpp| replace:: optional_deduced_sfinae.cpp
7385 .. _optional_deduced_sfinae_cpp: ../../test/optional_deduced_sfinae.cpp
7386 .. |mpl_cpp| replace:: mpl.cpp
7387 .. _mpl_cpp: ../../test/mpl.cpp
7388 .. |preprocessor_cpp| replace:: preprocessor.cpp
7389 .. _preprocessor_cpp: ../../test/preprocessor.cpp
7390 .. |preprocessor_deduced_cpp| replace:: preprocessor_deduced.cpp
7391 .. _preprocessor_deduced_cpp: ../../test/preprocessor_deduced.cpp
7392 .. |deduced_dep_pred_cpp| replace:: deduced_dependent_predicate.cpp
7393 .. _deduced_dep_pred_cpp: ../../test/deduced_dependent_predicate.cpp
7394 .. |macros_eval_cat_cpp| replace:: macros_eval_category.cpp
7395 .. _macros_eval_cat_cpp: ../../test/macros_eval_category.cpp
7396 .. |macros_cpp| replace:: macros.cpp
7397 .. _macros_cpp: ../../test/macros.cpp