From f2541bb90af059680aa7036f315f052175999355 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 8 Apr 2015 03:09:47 +0000 Subject: Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2. --- libs/variant/doc/reference/apply_visitor.xml | 115 ++++++++++++-- libs/variant/doc/reference/concepts.xml | 16 +- libs/variant/doc/reference/get.xml | 172 ++++++++++++++++++++- libs/variant/doc/reference/multivisitor.xml | 8 +- libs/variant/doc/reference/polymorphic_get.xml | 174 ++++++++++++++++++++- libs/variant/doc/reference/variant.xml | 205 ++++++++++++++++++++++++- libs/variant/doc/reference/variant_fwd.xml | 3 +- 7 files changed, 663 insertions(+), 30 deletions(-) (limited to 'libs/variant/doc/reference') diff --git a/libs/variant/doc/reference/apply_visitor.xml b/libs/variant/doc/reference/apply_visitor.xml index b9a8798f0..bd1f10fe7 100644 --- a/libs/variant/doc/reference/apply_visitor.xml +++ b/libs/variant/doc/reference/apply_visitor.xml @@ -21,6 +21,9 @@ See the "visitor-only" form of apply_visitor for a simple way to create apply_visitor_delayed_t objects. + See apply_visitor_delayed_cpp14_t + which is used on C++14 compatible compilers when Visitor has no + result_type typedef. - typename MultiVisitor::result_type + typename MultiVisitor::result_type OR decltype(auto) const MultiVisitor & @@ -219,6 +293,19 @@ + + + + + apply_visitor_delayed_cpp14_t<Visitor> + + + Visitor & + + + Allows compile-time checked type-safe application of the given visitor to the content of the given variant, ensuring that all @@ -243,13 +330,17 @@ Overloads accepting three or more operands invoke the function call operator of the given visitor on the content of the given variant - operands. Maximum amount of parameters controlled by + operands. Maximum amount of parameters controlled by BOOST_VARAINT_MAX_MULTIVIZITOR_PARAMS - macro. Those functions are actually defined in . - - The overload accepting only a visitor returns a - generic function object - that accepts either one or two arguments and invokes + macro. Those functions are actually defined in a header boost/variant/multivisitors.hpp + (See ). That header must be manually included + if multi visitors are meant for use. + + The overloads accepting only a visitor return a + C++03 compatible generic function object + or + C++14 compatible generic function object + that accepts either one, two or arbitrary count of arguments and invoke apply_visitor using these arguments and visitor, thus behaving as specified above. (This behavior is particularly useful, for diff --git a/libs/variant/doc/reference/concepts.xml b/libs/variant/doc/reference/concepts.xml index 78c418e4a..03534ec2c 100644 --- a/libs/variant/doc/reference/concepts.xml +++ b/libs/variant/doc/reference/concepts.xml @@ -82,7 +82,9 @@ Must allow invocation as a function by overloading operator(), unambiguously accepting any value of type T. - Must expose inner type result_type. (See + Must expose inner type result_type. C++14 compatible compilers + could detect result_type automatically, but will stick to + result_type if it is defined. (See boost::visitor_ptr for a solution to using functions as visitors.) If result_type is not void, then @@ -131,6 +133,18 @@ public: } }; + C++14 compatible compilers detect result_type automatically: + + + boost::variant<int, float> v; + // ... + + boost::apply_visitor( + [](auto val) { return std::to_string(val); }, + v + ); + + diff --git a/libs/variant/doc/reference/get.xml b/libs/variant/doc/reference/get.xml index d8231bf56..ed30aa8de 100644 --- a/libs/variant/doc/reference/get.xml +++ b/libs/variant/doc/reference/get.xml @@ -26,7 +26,7 @@ - + - typename MultiVisitor::result_type + typename MultiVisitor::result_type OR decltype(auto) const MultiVisitor & diff --git a/libs/variant/doc/reference/polymorphic_get.xml b/libs/variant/doc/reference/polymorphic_get.xml index f6d85384c..aea0a7599 100644 --- a/libs/variant/doc/reference/polymorphic_get.xml +++ b/libs/variant/doc/reference/polymorphic_get.xml @@ -26,7 +26,7 @@ - +