Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasujm committed Jul 23, 2020
1 parent e721c57 commit 9e03b53
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions cxx/include/enhanced_enum/enhanced_enum.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,34 @@ namespace enhanced_enum {

/** \brief Base class for the enhanced enumeration types
*
* All essential functionality of an enhanced enum type is implemented
* The essential functionality of an enhanced enum type is implemented
* in this class. A type gains the capabilities of an enhanced enum by
* deriving from this class, and defining static constant array \c
* values, as described in the user guide. The code for the derived
* class is intended to be autogenerated to ensure conformance with
* the requirements.
* deriving from this class, and defining a static constant array
* called \c values, as described in the user guide. The code for the
* derived class is intended to be autogenerated to ensure conformance
* with the requirements.
*
* There is order preserving isomorphism between the instances of \c
* EnhancedEnum, and the enumerators of the underlying \c
* There is an order-preserving isomorphism between the instances of
* \c EnhancedEnum, and the enumerators of the underlying \c
* LabelEnum. Thus, conceptually the instances of \c EnhancedEnum are
* its enumerators, and will be called so in this class reference.
* its enumerators, and will be called so in the documentation.
*
* An enumerator of \c EnhancedEnum simply stores the value of its
* label enumerator as its only member. Consequently, most of the
* traits of \c LabelEnum are also traits of the \c EnhancedEnum type:
* enhanced enumerations are regular, totally ordered, trivial, and
* layout compatible with their underlying label enumerators.
*
* \note It is assumed that the definition of the derived class is
* It is assumed that the definition of the derived class is
* compatible with the requirements imposed by the library. Most
* notably the derived class must not have any non-static data members
* or other non-empty base classes. The easiest way to ensure
* or other non-empty base classes. The intended way to ensure
* compatibility is to autogenerate the definition.
*
* \warning Trying to use an instance of a class derived from \ref
* enum_base not meeting the requirements imposed by the library
* results in undefined behavior.
*
* \tparam EnhancedEnum The enhanced enumeration. The base class template
* uses curiously recurring template pattern.
* \tparam LabelEnum The underlying enumeration (<tt>enum class</tt>)
Expand Down Expand Up @@ -172,6 +176,8 @@ struct enum_base {
}

/** \brief Return the value of the enumerator
*
* \throw std::out_of_range if \c *this is not a valid enumerator
*/
constexpr const value_type& value() const noexcept
{
Expand All @@ -195,7 +201,7 @@ private:
* \{
*/

/** \brief Convert a label enumeration to the enhanced enumeration
/** \brief Convert a label enumeration to an enhanced enumeration
*
* \tparam LabelEnum A label enum type (<tt>enum class</tt>)
*/
Expand Down

0 comments on commit 9e03b53

Please sign in to comment.