From 98c9595bf4dafb6e73010be8b248164a847cd4aa Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Mar 2017 02:28:03 +0200 Subject: [PATCH] Add Definitions section. --- doc/html/mp11.html | 45 +++++++++++++++++++++++++++++++++++++++- doc/mp11.qbk | 1 + doc/mp11/definitions.qbk | 32 ++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 doc/mp11/definitions.qbk diff --git a/doc/html/mp11.html b/doc/html/mp11.html index 52ca3fb..a1235fd 100644 --- a/doc/html/mp11.html +++ b/doc/html/mp11.html @@ -35,6 +35,7 @@
Overview
Reference
+
Definitions
Integral Constants, <boost/mp11/integral.hpp>
mp_bool<B>
@@ -202,6 +203,48 @@

+

+ A list is a — possibly but not necessarily variadic — template + class whose parameters are all types, for example mp_list<char[], + void>, + mp_list<>, + std::tuple<int, float, char>, + std::pair<int, float>, std::shared_ptr<X>. +

+

+ A metafunction is a class template or a template alias + whose parameters are all types, for example std::add_pointer_t, + std::is_const, mp_second, + mp_push_front, mp_list, std::tuple, + std::pair, std::shared_ptr, + or +

+
template<class...> using F1 = void;
+template<class T> using F2 = T*;
+template<class... T> using F3 = std::integral_constant<std::size_t, sizeof...(T)>;
+
+

+ A quoted metafunction is a class with a public metafunction + called invoke, for example +

+
struct Q1 { template<class...> using invoke = void; };
+struct Q2 { template<class T> using invoke = T*; };
+struct Q3 { template<class... T> using invoke = std::integral_constant<std::size_t, sizeof...(T)>; };
+
+

+ An integral constant type is a class with a public member + value that is an integral + constant in the C++ sense. For example, std::integral_constant<int, + 7>, + or +

+
struct N { static int constexpr value = 2; };
+
+
+ - +

Last revised: March 16, 2017 at 23:37:05 GMT

Last revised: March 17, 2017 at 00:17:37 GMT


diff --git a/doc/mp11.qbk b/doc/mp11.qbk index b28efa0..6a3052e 100644 --- a/doc/mp11.qbk +++ b/doc/mp11.qbk @@ -33,6 +33,7 @@ The contents of the library are in namespace `boost::mp11`, unless specified otherwise. +[include mp11/definitions.qbk] [include mp11/integral.qbk] [include mp11/list.qbk] [include mp11/utility.qbk] diff --git a/doc/mp11/definitions.qbk b/doc/mp11/definitions.qbk new file mode 100644 index 0000000..9a6cd8d --- /dev/null +++ b/doc/mp11/definitions.qbk @@ -0,0 +1,32 @@ +[/ + / Copyright 2017 Peter Dimov + / + / Distributed under the Boost Software License, Version 1.0. (See + / accompanying file LICENSE_1_0.txt or copy at + / http://www.boost.org/LICENSE_1_0.txt) + /] + +[section Definitions] + +A /list/ is a '''—''' possibly but not necessarily variadic '''—''' template class whose parameters are all types, +for example `mp_list`, `mp_list<>`, `std::tuple`, `std::pair`, `std::shared_ptr`. + +A /metafunction/ is a class template or a template alias whose parameters are all types, for example `std::add_pointer_t`, +`std::is_const`, `mp_second`, `mp_push_front`, `mp_list`, `std::tuple`, `std::pair`, `std::shared_ptr`, or + + template using F1 = void; + template using F2 = T*; + template using F3 = std::integral_constant; + +A /quoted metafunction/ is a class with a public metafunction called `invoke`, for example + + struct Q1 { template using invoke = void; }; + struct Q2 { template using invoke = T*; }; + struct Q3 { template using invoke = std::integral_constant; }; + +An /integral constant type/ is a class with a public member `value` that is an integral constant in the C++ sense. For example, +`std::integral_constant`, or + + struct N { static int constexpr value = 2; }; + +[endsect]