From fc29ed3d33051078448d23ad7717e34037b261d6 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 30 Dec 2019 00:09:04 +0100 Subject: doc: document the deriving.hpp header --- doc/src/index.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'doc') 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 \ derivable = type +.. _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:`` +======================================== + +This header contains the definition of the function template :cpp:func:`deriving`. + +Function template :cpp:func:`deriving` +-------------------------------------- + +.. cpp:function:: template \ + constexpr derivation_clause deriving(derivable... 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:`` ================================================= -- cgit v1.2.3