diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2020-01-04 00:33:45 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2020-01-04 00:33:45 +0100 |
| commit | 285d3d6f7e600a1a8a97cc22e68dcbb4a7102888 (patch) | |
| tree | 0ec72ac2fe1b8886938768495b1f89c4aae38ac7 /doc | |
| parent | 24aaa570635ffde4e8182ef15d35be4b558d59ab (diff) | |
| download | newtype-285d3d6f7e600a1a8a97cc22e68dcbb4a7102888.tar.xz newtype-285d3d6f7e600a1a8a97cc22e68dcbb4a7102888.zip | |
doc: improve constructor documentation
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/src/index.rst | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/doc/src/index.rst b/doc/src/index.rst index ff32dd0..7d0ff4e 100644 --- a/doc/src/index.rst +++ b/doc/src/index.rst @@ -87,44 +87,58 @@ Class template :cpp:class:`new_type` **Static Data Members** - .. cpp:var:: derivation_clause_type constexpr static derivation_clause = DerivationClause + .. cpp:var:: static derivation_clause_type constexpr derivation_clause = DerivationClause **Constructors** .. cpp:function:: constexpr new_type() - **noexcept specification:** This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is nothrow default-construtible. + Construct a new instance of this :cpp:class:`new_type` by default constructing the contained object. - **default definition:** This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is default-construtible. - Otherwise, this constructor shall be explicitely deleted. + :throws: Any exception thrown by the default constructor of this :cpp:class:`new_type`'s :cpp:type:`base_type`. + This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *nothrow default-construtible*. + :enablement: This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *default-construtible*. + Otherwise, this constructor shall be explicitely deleted. - .. cpp:function:: constexpr new_type(new_type const &) + .. cpp:function:: constexpr new_type(new_type const & other) - **noexcept specification:**: This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is nothrow copy-construtible. + Construct a new instance of this :cpp:class:`new_type` by copy-constructing the contained object using the value contained by :literal:`other`. - **default definition:** This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is copy-construtible. - Otherwise, this constructor shall be explicitely deleted. + :param other: An existing instance of this :cpp:class:`new_type` + :throws: Any exception thrown by the copy-constructor of this :cpp:class:`new_type`'s :cpp:type:`base_type`. + This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *nothrow copy-construtible*. + :enablement: This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *copy-construtible*. + Otherwise, this constructor shall be explicitely deleted. - .. cpp:function:: constexpr new_type(new_type &&) + .. cpp:function:: constexpr new_type(new_type && other) - **noexcept specification:**: This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is nothrow move-construtible. + Construct a new instance of this :cpp:class:`new_type` by move-constructing the contained object using the value contained by :literal:`other`. - **default definition:** This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is move-construtible. - Otherwise, this constructor shall be explicitely deleted. + :param other: An existing instance of this :cpp:class:`new_type` + :throws: Any exception thrown by the move-constructor of this :cpp:class:`new_type`'s :cpp:type:`base_type`. + This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *nothrow move-construtible*. + :enablement: This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *move-construtible*. + Otherwise, this constructor shall be explicitely deleted. - .. cpp:function:: constexpr new_type(BaseType &) + .. cpp:function:: constexpr new_type(BaseType const & value) - **noexcept specification:** This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is nothrow copy-construtible. + Construct a new instance of this :cpp:class:`new_type` by copy-constructing the contained object using :literal:`value`. - **enablement:** This constructor shall be defined iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is copy-construtible. - Otherwise, this constructor shall be explicitely deleted. + :param other: An existing instance of this :cpp:class:`new_type` + :throws: Any exception thrown by the copy-constructor of this :cpp:class:`new_type`'s :cpp:type:`base_type`. + This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *nothrow copy-construtible*. + :enablement: This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *copy-construtible*. + Otherwise, this constructor shall be explicitely deleted. - .. cpp:function:: constexpr new_type(BaseType &&) + .. cpp:function:: constexpr new_type(BaseType && value) - **noexcept specification:** This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is nothrow move-construtible. + Construct a new instance of this :cpp:class:`new_type` by move-constructing the contained object using :literal:`value`. - **enablement:** This constructor shall be defined iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is move-construtible. - Otherwise, this constructor shall be explicitely deleted. + :param other: An existing instance of this :cpp:class:`new_type` + :throws: Any exception thrown by the move-constructor of this :cpp:class:`new_type`'s :cpp:type:`base_type`. + This constructor shall be noexcept iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *nothrow move-construtible*. + :enablement: This constructor shall be defined as :literal:`= default` iff. this :cpp:class:`new_type`'s :cpp:type:`base_type` is *move-construtible*. + Otherwise, this constructor shall be explicitely deleted. **Assignment Operators** |
