aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2019-12-30 00:09:04 +0100
committerFelix Morgner <felix.morgner@gmail.com>2019-12-30 00:09:04 +0100
commitfc29ed3d33051078448d23ad7717e34037b261d6 (patch)
treecd2a53c0abba7711316634d05dd63cf40134df8e /doc
parent17b5aca0e087820cf0545ac6923242676dd042d6 (diff)
downloadnewtype-fc29ed3d33051078448d23ad7717e34037b261d6.tar.xz
newtype-fc29ed3d33051078448d23ad7717e34037b261d6.zip
doc: document the deriving.hpp header
Diffstat (limited to 'doc')
-rw-r--r--doc/src/index.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/src/index.rst b/doc/src/index.rst
index 62e41f2..cf35ed9 100644
--- a/doc/src/index.rst
+++ b/doc/src/index.rst
@@ -15,6 +15,10 @@ The ``newtype`` library provides types and functions to facilitate the creation
Example Usage
#############
+.. note::
+
+ All examples shown in this section can be found in the directory :literal:`examples/src` within the source root.
+
:ref:`new-type-usage-basic` below demonstrates the basic usage of :cpp:class:`new_type`.
In it, :cpp:class:`new_type` is used to create thre new strong aliases :literal:`Width`, :literal:`Height`, and :literal:`Area` that all alias :literal:`unsigned int`.
@@ -262,6 +266,8 @@ Alias template :cpp:type:`derivable`
.. cpp:type:: template<typename NameTag> \
derivable = type<NameTag>
+.. _sec-standard-derivation-tags:
+
Standard derivation tags
------------------------
@@ -295,6 +301,20 @@ Standard derivation tags
This tag enables the derivation of the "stream input" operator :cpp:func:`operator>>`
+Header :literal:`<newtype/deriving.hpp>`
+========================================
+
+This header contains the definition of the function template :cpp:func:`deriving`.
+
+Function template :cpp:func:`deriving`
+--------------------------------------
+
+.. cpp:function:: template<typename... DerivableTags> \
+ constexpr derivation_clause<DerivableTags...> deriving(derivable<DerivableTags>... features) noexcept
+
+ This function can be used to create a new :cpp:class:`derivation_clause` for use in the definitions of instances of :cpp:class:`new_type`.
+ See :ref:`sec-standard-derivation-tags` for a list of standard derivation tags.
+
Header :literal:`<newtype/derivation_clause.hpp>`
=================================================