From aca0416ba6f13d087348089fb4cc5d4c85b3705f Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 28 Dec 2019 15:12:24 +0100 Subject: doc: add outline for nt::derivation_clause --- doc/src/index.rst | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/src/index.rst b/doc/src/index.rst index 41f9675..e9c69c0 100644 --- a/doc/src/index.rst +++ b/doc/src/index.rst @@ -14,7 +14,7 @@ It provides detailed descriptions of the types and functions designed to be used Additionally, this section provides usage examples that demonstrate the use and properties of the public API. Class template :cpp:class:`new_type` ----------------------------------------- +------------------------------------ .. cpp:class:: template \ new_type @@ -24,7 +24,7 @@ Class template :cpp:class:`new_type` :tparam BaseType: The underlying type of the new strong alias :tparam TagType: A type uniquely identifying this string alias - :tparam DerivationClause: A :cpp:struct:`derivation_clause` listing all features that shall be automatically derived. + :tparam DerivationClause: A :cpp:class:`derivation_clause` listing all features that shall be automatically derived. Usage @@ -202,5 +202,62 @@ Free Relational Operators Free Stream Input/Ouput Operators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Class template :cpp:class:`derivation_clause` +--------------------------------------------- + +.. cpp:class:: template \ + derivation_clause + + Derivation clauses are used by :cpp:class:`new_type` to allow users to specify a set of automatically derived support functions. + + :tparam DerivableTags: A (possibly empty) list of derivation tags to mark automatically derived features + +Synopsis +~~~~~~~~ + +.. code-block:: c++ + + namespace nt + { + template + class derivation_clause + { + public: + // Constructors + + constexpr derivation_clause(derivable...) noexcept; + + // Evaluation functions + + template + auto constexpr operator()(derivable) const noexcept -> bool; + + template + auto constexpr operator()(derivable, derivable...) const noexcept -> bool; + + // Equality comparison operators + + template + auto constexpr operator==(derivation_clause other) const noexcept -> bool; + + template + auto constexpr operator!=(derivation_clause other) const noexcept -> bool; + + // Relational operators + + template + auto constexpr operator<(derivation_clause other) const noexcept -> bool; + + template + auto constexpr operator>(derivation_clause other) const noexcept -> bool; + + template + auto constexpr operator<=(derivation_clause other) const noexcept -> bool; + + template + auto constexpr operator>=(derivation_clause other) const noexcept -> bool; + }; + } + Unit Tests ========== -- cgit v1.2.3