|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70512 - in sandbox/enums/boost/enums: containers ordinal pp scoped
From: vicente.botet_at_[hidden]
Date: 2011-03-24 14:20:54
Author: viboes
Date: 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
New Revision: 70512
URL: http://svn.boost.org/trac/boost/changeset/70512
Log:
Enums: Added enum_set::reference + update comments
Text files modified:
sandbox/enums/boost/enums/containers/enum_array.hpp | 116 ++++++------
sandbox/enums/boost/enums/containers/enum_range.hpp | 69 ++++---
sandbox/enums/boost/enums/containers/enum_set.hpp | 356 +++++++++++++++++++++++++--------------
sandbox/enums/boost/enums/ordinal/first.hpp | 4
sandbox/enums/boost/enums/ordinal/last.hpp | 4
sandbox/enums/boost/enums/ordinal/linear_traiter.hpp | 10
sandbox/enums/boost/enums/ordinal/pos.hpp | 14
sandbox/enums/boost/enums/ordinal/pred.hpp | 6
sandbox/enums/boost/enums/ordinal/size.hpp | 6
sandbox/enums/boost/enums/ordinal/succ.hpp | 15
sandbox/enums/boost/enums/ordinal/val.hpp | 8
sandbox/enums/boost/enums/pp/enum_declaration.hpp | 101 +++++-----
sandbox/enums/boost/enums/pp/enumerator_definition.hpp | 50 ++---
sandbox/enums/boost/enums/pp/namespaces.hpp | 52 ++--
sandbox/enums/boost/enums/scoped/default_value.hpp | 11 +
sandbox/enums/boost/enums/scoped/enum_class_cons.hpp | 89 +++++++--
sandbox/enums/boost/enums/scoped/native_value.hpp | 11 +
sandbox/enums/boost/enums/scoped/scoping_type.hpp | 23 +-
sandbox/enums/boost/enums/scoped/underlying_type.hpp | 5
sandbox/enums/boost/enums/scoped/underlying_value.hpp | 11 +
20 files changed, 578 insertions(+), 383 deletions(-)
Modified: sandbox/enums/boost/enums/containers/enum_array.hpp
==============================================================================
--- sandbox/enums/boost/enums/containers/enum_array.hpp (original)
+++ sandbox/enums/boost/enums/containers/enum_array.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -57,7 +57,7 @@
/*!
An \c enum_array supports random access iterators. An instance of \c enum_array<T, EC>
- stores as many elements of type \c T as enum literals are on the enum class \c EC,
+ stores as many elements of type \c T as enum literals are on the ordinal enum \c EC,
so that <tt>size() == meta::size<EC>::value</tt> is an invariant.
The elements of an \c enum_array are stored contiguously, meaning that if \c a is an
@@ -89,19 +89,19 @@
- \note The member variable elems is shown for exposition only, to emphasize
+ @Note The member variable elems is shown for exposition only, to emphasize
that enum_array is a class aggregate. The name elems is not part of
- enum_array's interface
-
- \param T array's element type
- \param EC array's index enumeration class
+ enum_array's interface.
+ @TParams
+ @Param{T,array's element type}
+ @Param{EC,array's index ordinal enum}
*/
template<class T, typename EC>
class enum_array {
public:
- //! // exposition only
- T elems[meta::size<EC>::value]; // fixed-size array of elements of type T
+ //! For exposition only
+ T elems[meta::size<EC>::value]; //! fixed-size array of elements of type T
public:
// type definitions
@@ -119,21 +119,21 @@
//enum_array() {}
// iterator support
- //! \returns iterator for the first element
- //! \throws Nothing
+ //! @Returns iterator for the first element
+ //! @Throws Nothing
iterator begin() { return elems; }
- //! \returns const iterator for the first element
- //! \throws Nothing
+ //! @Returns const iterator for the first element
+ //! @Throws Nothing
const_iterator begin() const { return elems; }
const_iterator cbegin() const { return elems; }
- //! \returns iterator for position after the last element
- //! \throws Nothing
+ //! @Returns iterator for position after the last element
+ //! @Throws Nothing
iterator end() { return elems+static_size; }
- //! \returns const iterator for position after the last element
- //! \throws Nothing
+ //! @Returns const iterator for position after the last element
+ //! @Throws Nothing
const_iterator end() const { return elems+static_size; }
const_iterator cend() const { return elems+static_size; }
@@ -158,7 +158,7 @@
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
#endif
- //! \returns reverse iterator for the first element of reverse iteration
+ //! @Returns reverse iterator for the first element of reverse iteration
reverse_iterator rbegin() {
return reverse_iterator(end());
}
@@ -169,7 +169,7 @@
return const_reverse_iterator(end());
}
- //! \returns reverse iterator for position after the last element in reverse iteration
+ //! @Returns reverse iterator for position after the last element in reverse iteration
reverse_iterator rend() {
return reverse_iterator(begin());
}
@@ -181,9 +181,9 @@
}
// operator[]
- //! Requires: k'pos < static_size
- //! \returns reference to the element with key k
- //! \throws Nothing.
+ //! @Requires <tt>k'pos < static_size</tt>
+ //! @Returns reference to the element with key @c k
+ //! @Throws Nothing.
reference operator[](key_type k)
{
size_type i = pos(k);
@@ -191,9 +191,9 @@
return elems[i];
}
- //! Requires: k'pos < static_size
- //! \returns constant reference to the element with key k
- //! \throws Nothing.
+ //! @Requires <tt>k'pos < static_size</tt>
+ //! @Returns constant reference to the element with key k
+ //! @Throws Nothing.
const_reference operator[](key_type k) const
{
size_type i = pos(k);
@@ -202,8 +202,8 @@
}
// at() with range check
- //! \returns element with key k
- //! \throws std::range_error if i >= static_size
+ //! @Returns element with key k
+ //! @Throws std::range_error if i >= static_size
reference at(key_type k)
{
size_type i = rangecheck(k);
@@ -216,57 +216,57 @@
}
// front() and back()
- //! \returns reference to the first element
- //! \throws Nothing
+ //! @Returns reference to the first element
+ //! @Throws Nothing
reference front()
{
return elems[0];
}
- //! \returns const reference to the first element
- //! \throws Nothing
+ //! @Returns const reference to the first element
+ //! @Throws Nothing
const_reference front() const
{
return elems[0];
}
- //! \returns reference to the last element
- //! \throws Nothing
+ //! @Returns reference to the last element
+ //! @Throws Nothing
reference back()
{
return elems[static_size-1];
}
- //! \returns const reference to the last element
- //! \throws Nothing
+ //! @Returns const reference to the last element
+ //! @Throws Nothing
const_reference back() const
{
return elems[static_size-1];
}
// size is constant
- //! \returns linear in meta::size<EC>::value.
+ //! @Returns linear in meta::size<EC>::value.
BOOST_CONSTEXPR size_type size()
{
return static_size;
}
- //! \returns false
- //! \throws Nothing
+ //! @Returns false
+ //! @Throws Nothing
static bool empty()
{
return false;
}
- //! \returns linear in meta::size<EC>::value.
+ //! @Returns linear in meta::size<EC>::value.
BOOST_CONSTEXPR size_type max_size()
{
return static_size;
}
- /*! Effects: swap_ranges(begin(), end(), y.begin())
- \throws Nothing unless one of the element-wise swap calls throws an exception.
- Note: Unlike the swap function for other containers, enum_array::swap
+ /*! @Effects <tt>swap_ranges(begin(), end(), y.begin())</tt>
+ @Throws Nothing unless one of the element-wise swap calls throws an exception.
+ Note: Unlike the @c swap function for other containers, @c enum_array::swap
takes linear time, may exit via an exception, and does not cause
iterators to become associated with the other container.
*/
@@ -276,43 +276,43 @@
boost::swap(elems[i],y.elems[i]);
}
- // direct access to data (read-only)
+ //! direct access to data (read-only)
- //! \returns elems.
+ //! @Returns elems.
const T* data() const {
return elems;
}
- //! \returns elems.
+ //! @Returns elems.
T* data() {
return elems;
}
- // use enum_array as C array (direct read/write access to data)
+ //! use @c enum_array as C array (direct read/write access to data)
T* c_array() {
return elems;
}
- // assignment with type conversion
+ //! assignment with type conversion
template <typename T2>
enum_array<T,EC>& operator= (const enum_array<T2,EC>& rhs) {
std::copy(rhs.begin(),rhs.end(), begin());
return *this;
}
- // A synonym for fill
- // assign one value to all elements
- //! Effects: std::fill_n(begin(), static_size, value)
+ //! A synonym for fill
+ //! assign one value to all elements
+ //! @Effects <tt>std::fill_n(begin(), static_size, value)</tt>
void assign (const T& value) {
fill ( value );
}
- //! Effects: fill_n(begin(), static_size, u)
+ //! @Effects <tt>fill_n(begin(), static_size, u)</tt>
void fill (const T& value)
{
std::fill_n(begin(),size(),value);
}
- // check range (may be private because it is static)
+ //! check range (may be private because it is static)
static size_type rangecheck (key_type k) {
size_type i = enums::pos(k);
if (i >= static_size) {
@@ -327,40 +327,40 @@
// comparisons
- //! \returns std::equal(x.begin(), x.end(), y.begin())
+ //! @Returns <tt>std::equal(x.begin(), x.end(), y.begin())</tt>
template<class T, typename EC>
bool operator== (const enum_array<T,EC>& x, const enum_array<T,EC>& y)
{
return std::equal(x.begin(), x.end(), y.begin());
}
- //! \returns std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end())
+ //! @Returns <tt>std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end())</tt>
template<class T, typename EC>
bool operator< (const enum_array<T,EC>& x, const enum_array<T,EC>& y)
{
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
}
- //! \returns !(x == y)
+ //! @Returns <tt>!(x == y)</tt>
template<class T, typename EC>
bool operator!= (const enum_array<T,EC>& x, const enum_array<T,EC>& y)
{
return !(x==y);
}
- //! \returns y < x
+ //! @Returns <tt>y < x</tt>
template<class T, typename EC>
bool operator> (const enum_array<T,EC>& x, const enum_array<T,EC>& y)
{
return y<x;
}
- //! \returns !(y<x)
+ //! @Returns <tt>!(y<x)</tt>
template<class T, typename EC>
bool operator<= (const enum_array<T,EC>& x, const enum_array<T,EC>& y)
{
return !(y<x);
}
- //! \returns !(x<y)
+ //! @Returns <tt>!(x<y)</tt>
template<class T, typename EC>
bool operator>= (const enum_array<T,EC>& x, const enum_array<T,EC>& y)
{
@@ -369,7 +369,7 @@
//! enum_array's swap
- //! <b>Effects:</b> As
+ //! <b>@Effects</b> As
//! \code
//! x.swap(y);
//! \endcode
Modified: sandbox/enums/boost/enums/containers/enum_range.hpp
==============================================================================
--- sandbox/enums/boost/enums/containers/enum_range.hpp (original)
+++ sandbox/enums/boost/enums/containers/enum_range.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -13,7 +13,7 @@
/*!
\file
\brief
- The header \c <boost/enums/©enum_range.hpp> defines a class template \c enum_range for viewing an enumerations as a range.
+ The header \c <boost/enums/container/enum_range.hpp> defines a class template \c enum_range for viewing an enumerations as a range.
*/
#ifndef BOOST_ENUMS_CONTAINERS_ENUM_RANGE_HPP
@@ -38,27 +38,27 @@
// This is useful for implementing the enum_range<E>()
// function.
//
- // Note:
+ // @Note
// This use of this iterator and enum_range<E>() is appreciably less
// performant than the corresponding hand-written integer
// loop on many compilers.
//! enum_iterator is a model of RandomAccessIterator
- template<typename EC /* , typename Traits=enum_range_traits<EC> */ >
+ template<typename T /* , typename Traits=enum_range_traits<T> */ >
class enum_iterator
: public boost::iterator_facade<
- enum_iterator<EC>,
- EC,
+ enum_iterator<T>,
+ T,
boost::random_access_traversal_tag,
- EC,
+ T,
std::ptrdiff_t
>
{
typedef boost::iterator_facade<
- enum_iterator<EC>,
- EC,
+ enum_iterator<T>,
+ T,
boost::random_access_traversal_tag,
- EC,
+ T,
std::ptrdiff_t
> base_t;
public:
@@ -97,7 +97,7 @@
reference dereference() const
{
- return enums::val<EC>(index_);
+ return enums::val<T>(index_);
}
friend class ::boost::iterator_core_access;
@@ -105,24 +105,32 @@
};
} // namespace enums_detail
#endif
- //! \c enum_range is a model of the \e RandomAccessRange Concept associated to the enumeration \c EC.
-
+
+
+ /**
+ @TParams
+ @Param{T,set's element ordinal enum}
+
+ @Requires @c T must be a model of <em>OrdinalEnum</em>.
+
+ \c enum_range is a model of the <em>RandomAccessRange</em> Concept associated to the enumeration \c T.
+ */
- template<typename EC/* , typename Traits=enum_range_traits<EC> */ >
+ template<typename T/* , typename Traits=enum_range_traits<T> */ >
class enum_range
- : public iterator_range< enums_detail::enum_iterator<EC/*, Traits*/> >
+ : public iterator_range< enums_detail::enum_iterator<T/*, Traits*/> >
{
- typedef enums_detail::enum_iterator<EC/*, Traits*/> iterator_t;
+ typedef enums_detail::enum_iterator<T/*, Traits*/> iterator_t;
typedef iterator_range<iterator_t> base_t;
public:
//! builds a enum range
enum_range()
- : base_t(iterator_t(0), iterator_t(enums::meta::size<EC>::value))
+ : base_t(iterator_t(0), iterator_t(enums::meta::size<T>::value))
{
}
//! builds a enum sub-range
- enum_range(EC first, EC last)
+ enum_range(T first, T last)
: base_t(iterator_t(enums::pos(first)),
iterator_t(enums::pos(last)+1))
{
@@ -133,27 +141,30 @@
//! \c make_range allows treating enums as a model of the \e RandomAccessRange Concept.
- //! \pre \c EC is a model of the \e Enumeration Concept.
-
- template<typename EC /*, typename Traits*/ >
- enum_range<EC>
+ //! @Requires \c T is a model of the \e Enumeration Concept.
+ //! @Returns an enum range from @c T'first to @c T'last inclusive.
+ template<typename T /*, typename Traits*/ >
+ enum_range<T>
make_range()
{
- return enum_range<EC/*,Traits*/>();
+ return enum_range<T/*,Traits*/>();
}
//! function to generate an enum sub-range.
//! \c make_range allows treating enums as a model of the \e RandomAccessRange Concept.
//! It should be noted that the first and last parameters denoted a closed range.
- //! \pre \c EC is a model of the \e Enumeration Concept.
- //! \param first first element of the range
- //! \param last last element of the range
- template<typename EC /*, typename Traits */ >
- enum_range<EC>
- make_range(EC first, EC last)
+ //! @Requires \c T is a model of the \e Enumeration Concept.
+ //! @Params
+ //! @Param{first,first element of the range}
+ //! @Param{last,last element of the range}
+ //! @Returns an enum range from @c first to @c last inclusive.
+
+ template<typename T /*, typename Traits */ >
+ enum_range<T>
+ make_range(T first, T last)
{
- return enum_range<EC /*,Traits*/ >(first,last);
+ return enum_range<T /*,Traits*/ >(first,last);
}
} // namespace enums
Modified: sandbox/enums/boost/enums/containers/enum_set.hpp
==============================================================================
--- sandbox/enums/boost/enums/containers/enum_set.hpp (original)
+++ sandbox/enums/boost/enums/containers/enum_set.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -15,7 +15,7 @@
/*!
\file
\brief
- The header \c <boost/enums/containers/enum_set.hpp> defines a class template \c enum_set<EC> for managing sets of enumeration and several
+ The header \c <boost/enums/containers/enum_set.hpp> defines a class template \c enum_set<T> for managing sets of enumeration and several
//! related functions for representing and manipulating sets of enums. We can say that
\c enum_set is the counterpart of \c std::bitset when the index are enums.
*/
@@ -39,31 +39,104 @@
namespace boost {
namespace enums {
- template<typename EC /*,
- typename Traits=enum_subrange_traiter<EC>*/ >
+ /**
+ @TParams
+ @Param{T,set's element ordinal enum}
+ @Requires @c T must be a model of <em>OrdinalEnum</em>.
+
+ The class template @c enum_set<T> describes an object that can store a sequence
+ consisting of a fixed number of bits, given by @c enums::meta::size<T>::value.
+
+ Each bit represents either the value zero (reset) or one (set). To toggle
+ a bit is to change the value zero to one, or the value one to zero. Each
+ bit has a non-negative position pos. When converting between an object of
+ class enum_set<T> and a value of some integral type, bit position pos
+ corresponds to the bit value 1<<pos. The integral value corresponding to
+ two or more bits is the sum of their bit values.
+ The functions described in this section can report three kinds of errors,
+ each associated with a distinct exception:
+ - an invalid-argument error is associated with exceptions of type @c std::invalid_argument;
+ - an out-of-range error is associated with exceptions of type @c std::out_of_range;
+ - an overflow error is associated with exceptions of type @c std::overflow_error.
+
+ */
+ template<typename T>
+ class enum_set;
+
+ template<typename T>
class enum_set
{
public:
- struct reference {
+ //! @brief A proxy class that acts as a reference to a single bit.
+
+ //! It contains an assignment operator, a conversion to @c bool,
+ //! an @c operator~, and a member function @c flip.
+ //! It exists only as a helper class for @c enum_set's @c operator[].
+ class reference {
+ friend class enum_set<T>;
+ enum_set<T>& ref_;
+ T pos_;
+ reference();
+ reference(enum_set<T>& ref, T pos)
+ : ref_(ref), pos_(pos)
+ { }
+ public:
+ ~reference()
+ { }
+
+ //! assignement from bool
+ reference& operator=(bool x)
+ {
+ ref_.set(pos_,x);
+ return *this;
+ }
+
+ //! assignement from another reference
+ reference& operator=(const reference& x)
+ {
+ ref_.set(pos_,x);
+ return *this;
+ }
+
+ //! flip the bit
+ bool operator~() const
+ {
+ return ref_.flip(pos_);
+ }
+
+ //! implicit conversion to bool
+ operator bool() const
+ {
+ return ref_.test(pos_);
+ }
+
+ //! flip the bit
+ reference flip() const
+ {
+ return ref_.flip(pos_);
+ }
};
- //! <b> Effects:</b> Constructs an object of class \c enum_set<>, initializing all
+ //! @Effects Constructs an object of class \c enum_set<>, initializing all
//! enumerations to zero.
+ //! @NoExcept
BOOST_CONSTEXPR enum_set()
{
}
- //~ BOOST_CONSTEXPR
+ // BOOST_CONSTEXPR
// Need to be refactored to be a constexpr
- //~ error: constexpr constructor does not have empty body
- explicit enum_set(EC setting)
+ // error: constexpr constructor does not have empty body
+ explicit enum_set(T setting)
{
set(setting);
}
- //! <b> Effects:</b> Constructs an object of class \c enum_set<>, initializing the
+ //! @Effects Constructs an object of class \c enum_set<>, initializing the
//! first \c M bit positions to the corresponding bit values in \c val.
//! \c M is the smaller of \c N and the number of bits in the value
//! representation of \c unsigned \c long \c long. If \c M<N, the remaining bit
//! positions are initialized to zero.
+ //! @NoExcept
+
BOOST_CONSTEXPR explicit enum_set(unsigned long long val)
: bits(val)
{
@@ -72,14 +145,14 @@
#if 1
#else
- //! \pre <tt>pos <= str.size()</tt>.
- //! \throws out_of_range if <tt>pos > str.size()</tt>.
- //! <b> Effects:</b> Determines the effective length \c rlen of the initializing
+ //! @Requires <tt>pos <= str.size()</tt>.
+ //! @Throws std::out_of_range if <tt>pos > str.size()</tt>.
+ //! @Effects Determines the effective length \c rlen of the initializing
//! string as the smaller of \c n and <tt>str.size()-pos</tt>.
- //! The function then throws \c invalid_argument if any of the \c rlen
+ //! The function then throws \c std::invalid_argument if any of the \c rlen
//! characters in \c str beginning at position pos is other than zero or one.
- //! The function uses \c ch_traits::eq() to compare the character values.
- //! Otherwise, the function constructs an object of class \c enum_set<EC>,
+ //! The function uses \c traits::eq() to compare the character values.
+ //! Otherwise, the function constructs an object of class \c enum_set<T>,
//! initializing the first \c M bit positions to values determined from the
//! corresponding characters in the string \c str. \c M is the smaller of \c N and
//! \c rlen.\n
@@ -88,17 +161,17 @@
//! Otherwise, the element has the value 1. Character position \c pos+M-1
//! corresponds to bit position zero. Subsequent decreasing character
//! positions correspond to increasing bit positions.
- //! If \c M<N, remaining bit positions are initialized to zero.
- template<class charT, class ch_traits, class TAllocator>
- explicit enum_set(const std::basic_string<charT,ch_traits,TAllocator>& str,
- typename std::basic_string<charT,ch_traits,TAllocator>::size_type pos = 0,
- typename std::basic_string<charT,ch_traits,TAllocator>::size_type n =
- std::basic_string<charT,ch_traits,TAllocator>::npos,
+ //! If \c M<enums::meta::size<T>::value, remaining bit positions are initialized to zero.
+ template<class charT, class traits, class TAllocator>
+ explicit enum_set(const std::basic_string<charT,traits,TAllocator>& str,
+ typename std::basic_string<charT,traits,TAllocator>::size_type pos = 0,
+ typename std::basic_string<charT,traits,TAllocator>::size_type n =
+ std::basic_string<charT,traits,TAllocator>::npos,
charT zero = charT('0'), charT one = charT('1'))
: bits(str, pos, n, zero, one)
{}
- //! <b> Effects:</b> Constructs an object of class enum_set<N> as if by enum_set(string(str)).
+ //! @Effects Constructs an object of class enum_set<N> as if by enum_set(string(str)).
template <class charT>
explicit enum_set(const charT* str,
typename std::basic_string<charT>::size_type n = std::basic_string<charT>::npos,
@@ -107,47 +180,52 @@
{}
#endif
- //! <b> Effects:</b> Clears each bit in \c *this for which the corresponding bit in
+ //! @Effects Clears each bit in \c *this for which the corresponding bit in
//! \c rhs is clear, and leaves all other bits unchanged.
- //! \returns \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &operator&=(const enum_set &rhs)
{
bits &= rhs.bits;
return *this;
}
- //! <b> Effects:</b> Sets each bit in \c *this for which the corresponding bit in
+ //! @Effects Sets each bit in \c *this for which the corresponding bit in
//! \c rhs is set, and leaves all other bits unchanged.
- //! \returns \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &operator|=(const enum_set &rhs)
{
bits |= rhs.bits;
return *this;
}
- //! <b> Effects:</b> Toggles each bit in \c *this for which the corresponding bit in
+ //! @Effects Toggles each bit in \c *this for which the corresponding bit in
//! \c rhs is set, and leaves all other bits unchanged.
- //! \returns \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &operator^=(const enum_set &rhs)
{
bits ^= rhs.bits;
return *this;
}
- //! <b> Effects:</b> Replaces each bit at position \c I in \c *this with a value determined as follows:
+ //! @Effects Replaces each bit at position \c I in \c *this with a value determined as follows:
//! - If \c I<pos, the new value is zero;
//! - If \c I>=pos, the new value is the previous value of the bit at position \c I-pos.
- //! \returns \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &operator<<=(const enum_set &rhs)
{
bits <<= rhs.bits;
return *this;
}
- //! <b> Effects:</b> Replaces each bit at position \c I in \c *this with a value determined as follows:
+ //! @Effects Replaces each bit at position \c I in \c *this with a value determined as follows:
//! - If \c pos>=N-I, the new value is zero;
//! - If \c pos<N-I, the new value is the previous value of the bit at position \c I+pos.
- //! \returns \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &operator>>=(const enum_set &rhs)
{
@@ -155,39 +233,42 @@
return *this;
}
- //! \returns A count of the number of bits set in \c *this.
+ //! @Returns A count of the number of bits set in \c *this.
std::size_t count() const
{
return bits.count();
}
- //! \returns \c static_size.
+ //! @Returns \c static_size.
BOOST_CONSTEXPR std::size_t size() const
{
return bits.size();
}
- //! \pre \c pos shall be valid.
- //! \throws nothing.
- //! \returns \c true if the bit at position \c pos in \c *this has the value one,
+ //! @Requires \c pos shall be valid.
+ //! @Throws std::invalid_argument if @c e does not have a valid position.
+ //! @Returns \c true if the bit at the associated position of \c e in \c *this has the value one,
//! otherwise \c false.
- BOOST_CONSTEXPR bool operator[](EC testing) const
+ BOOST_CONSTEXPR bool operator[](T e) const
{
- return bits.test(to_bit(testing));
+ return bits.test(to_bit(e));
}
- //! \pre \c pos shall be valid.
- //! \throws nothing.
- //! \returns An object of type \c enum_set<EC>::reference such that
+ //! @Requires \c pos shall be valid.
+ //! @Throws std::invalid_argument if @c e does not have a valid position.
+ //! @Returns An object of type \c enum_set<T>::reference such that
//! <tt>(*this)[pos] == this->test(pos)</tt>, and such that <tt>(*this)[pos] = val</tt> is
//! equivalent to <tt>this->set(pos, val)</tt>.
- //! \note For the purpose of determining the presence of a data race,
+ //! @Note For the purpose of determining the presence of a data race,
//! any access or update through the resulting reference potentially
//! accesses or modifies, respectively, the entire underlying bitset.
- reference operator[](std::size_t pos); // for b[i];
-
- //! <b> Effects:</b> Sets all bits in \c *this.
- //! \returns \c *this.
+ reference operator[](T pos)
+ {
+ return reference(*this,pos);
+ }
+ //! @Effects Sets all bits in \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &set()
{
@@ -195,58 +276,60 @@
return *this;
}
- //! \pre \c setting is valid
- //! \throws out_of_range if \c pos does not correspond to a valid bit position.
- //! <b> Effects:</b> Stores a new value in the bit at the position associated to \c setting in \c *this.
+ //! @Requires \c setting is valid
+ //! @Throws @c std::invalid_argument if @c setting does have a invalid bit position.
+ //! @Effects Stores a new value in the bit at the position associated to \c setting in \c *this.
//! If \c value is nonzero, the stored value is one, otherwise it is zero.
- //! \returns \c *this.
- enum_set &set(EC setting, bool value = true)
+ //! @Returns \c *this.
+ enum_set &set(T setting, bool value = true)
{
bits.set(to_bit(setting), value);
return *this;
}
- //! <b> Effects:</b> Resets all bits in \c *this.
- //! \returns \c *this.
+ //! @Effects Resets all bits in \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &reset()
{
bits.reset();
return *this;
}
- //! \pre \c resetting is valid
- //! \throws out_of_range if \c resetting does not correspond to a valid enum.
- //! <b> Effects:</b> Resets the bit at the position associated to \c resetting in \c *this.
- //! \returns \c *this.
+ //! @Requires \c resetting is valid
+ //! @Throws @c std::invalid_argument if \c resetting does not correspond to a valid enum.
+ //! @Effects Resets the bit at the position associated to \c resetting in \c *this.
+ //! @Returns \c *this.
- enum_set &reset(EC resetting)
+ enum_set &reset(T resetting)
{
bits.reset(to_bit(resetting));
return *this;
}
- //! <b> Effects:</b> Toggles all bits in \c *this.
- //! \returns \c *this.
+ //! @Effects Toggles all bits in \c *this.
+ //! @Returns \c *this.
+ //! @NoExcept
enum_set &flip()
{
bits.flip();
return *this;
}
- //! \pre \c flipping is valid
- //! \throws out_of_range if \c flipping does not correspond to a valid enum.
- //! <b> Effects:</b> Toggles the bit at position associated to \c pos in \c *this.
- //! \returns \c *this.
- enum_set &flip(EC flipping)
+ //! @Requires \c flipping is valid
+ //! @Throws std::invalid_argument if \c flipping does not correspond to a valid enum.
+ //! @Effects Toggles the bit at position associated to \c pos in \c *this.
+ //! @Returns \c *this.
+ enum_set &flip(T flipping)
{
bits.flip(to_bit(flipping));
return *this;
}
//! \c <tt>unsigned long</tt> conversion
- //! \throws overflow_error if the integral value \c x corresponding to the
+ //! @Throws @c std::overflow_error if the integral value \c x corresponding to the
//! bits in \c *this cannot be represented as type <<tt>unsigned long</tt>.
- //! \returns \c x.
+ //! @Returns \c x.
unsigned long to_ulong() const
{
@@ -254,60 +337,68 @@
}
//! \c <tt>unsigned long long</tt> conversion
- //! \throws overflow_error if the integral value \c x corresponding to the
+ //! @Throws @c std::overflow_error if the integral value \c x corresponding to the
//! bits in \c *this cannot be represented as type <tt>unsigned long long</tt>.
- //! \returns \c x.
+ //! @Returns \c x.
unsigned long long to_ullong() const
{
return bits.to_ulong();
}
#ifdef BOOST_ENUMS_DOXYGEN_INVOKED
- //! <b> Effects:</b> Constructs a string object of the appropriate type and
+ //! @Effects Constructs a string object of the appropriate type and
//! initializes it to a string of length \c N characters. Each character is
//! determined by the value of its corresponding bit position in \c *this.
//! Character position \c N-1 corresponds to bit position zero.
//! Subsequent decreasing character positions correspond to increasing
//! bit positions. Bit value zero becomes the character zero, bit value
//! one becomes the character one.
- //! \returns The created object.
+ //! @Returns The created object.
template <class charT = char,
class traits = std::char_traits<charT>,
class Allocator = std::allocator<charT> >
std::basic_string<charT, traits, Allocator>
to_string(charT zero = charT('0'), charT one = charT('1')) const;
#endif
- //! <b> Effects:</b> Constructs an object x of class enum_set<EC> and initializes it with *this.
- //! \returns \c x.flip().
+ //! @Effects Constructs an object @c x of class @c enum_set<T> and initializes it with @c *this.
+ //! @Returns \c x.flip().
+ //! @NoExcept
enum_set operator~() const
{
return enum_set(*this).flip();
}
- //! \pre \c testing is valid
- //! \throws out_of_range if the associated position of \c testing does not correspond to a valid bit position.
- //! \returns \c true if the bit at position \c pos in \c *this has the value one.
- bool test(EC testing);
-
- //! \returns <tt>count() == size()</tt>
+ //! @Requires \c testing is valid
+ //! @Throws out_of_range if the associated position of \c testing does not correspond to a valid bit position.
+ //! @Returns \c true if the bit at position \c pos in \c *this has the value one.
+ bool test(T testing)
+ {
+ return bits.test(to_bit(testing));
+ }
+
+ //! @Returns <tt>count() == size()</tt>
+ //! @NoExcept
bool all() const
{
return bits.all();
}
- //! \returns <tt>count() != 0</tt>
+ //! @Returns <tt>count() != 0</tt>
+ //! @NoExcept
bool any() const
{
return bits.any();
}
- //! \returns <tt>count() == 0</tt>
+ //! @Returns <tt>count() == 0</tt>
+ //! @NoExcept
bool none() const
{
return bits.none();
}
- //! \returns <tt>enum_set<EC>(*this) <<= pos</tt>.
+ //! @Returns <tt>enum_set<T>(*this) <<= pos</tt>.
+ //! @NoExcept
enum_set operator<<(std::size_t pos) const
{
enum_set r = *this;
@@ -315,7 +406,8 @@
return r;
}
- //! \returns <tt>enum_set<EC>(*this) >>= pos</tt>.
+ //! @Returns <tt>enum_set<T>(*this) >>= pos</tt>.
+ //! @NoExcept
enum_set operator>>(std::size_t pos) const
{
enum_set r = *this;
@@ -323,66 +415,71 @@
return r;
}
- //! \returns A nonzero value if the value of each bit in \c *this equals the
+ //! @Returns A nonzero value if the value of each bit in \c *this equals the
//! value of the corresponding bit in \c rhs.
+ //! @NoExcept
bool operator==(const enum_set& rhs) const;
- //! \returns A nonzero value if <tt>!(*this == rhs)</tt>.
+ //! @Returns A nonzero value if <tt>!(*this == rhs)</tt>.
+ //! @NoExcept
bool operator!=(const enum_set& rhs) const;
private:
- static std::size_t to_bit(EC value)
+ static std::size_t to_bit(T value)
{
return enums::pos(value);
}
- std::bitset<enums::meta::size<EC>::value> bits;
+ std::bitset<enums::meta::size<T>::value> bits;
public:
- std::bitset<enums::meta::size<EC>::value> detail_bits() { return bits; }
+ std::bitset<enums::meta::size<T>::value> detail_bits() { return bits; }
};
// enum_set operators:
//! Intersection
- //! \returns enum_set<EC>(lhs) &= rhs.
- template <typename EC/*, typename Traits*/>
- enum_set<EC/*,Traits*/> operator&(const enum_set<EC/*,Traits*/>& x, const enum_set<EC/*,Traits*/>& y)
+ //! @Returns <tt>enum_set<T>(lhs) &= rhs</tt>.
+ //! @NoExcept
+ template <typename T>
+ enum_set<T> operator&(const enum_set<T>& x, const enum_set<T>& y)
{
- enum_set<EC/*,Traits*/> r = x;
+ enum_set<T> r = x;
r &= y;
return r;
}
//! Union
- //! \returns enum_set<EC>>(lhs) |= rhs.
- template <typename EC/*, typename Traits*/ >
- enum_set<EC/*,Traits*/> operator|(const enum_set<EC/*,Traits*/>& x, const enum_set<EC/*,Traits*/>& y)
+ //! @Returns <tt>enum_set<T>>(lhs) |= rhs</tt>.
+ //! @NoExcept
+ template <typename T >
+ enum_set<T> operator|(const enum_set<T>& x, const enum_set<T>& y)
{
- enum_set<EC/*,Traits*/> r = x;
+ enum_set<T> r = x;
r |= y;
return r;
}
//! Exclusive union
- //! \returns enum_set<EC>(lhs) ^= rhs.
- template <typename EC/*, typename Traits*/ >
- enum_set<EC/*,Traits*/> operator^(const enum_set<EC/*,Traits*/>& x, const enum_set<EC/*,Traits*/>& y)
+ //! @Returns <tt>enum_set<T>(lhs) ^= rhs</tt>.
+ //! @NoExcept
+ template <typename T >
+ enum_set<T> operator^(const enum_set<T>& x, const enum_set<T>& y)
{
- enum_set<EC/*,Traits*/> r = x;
+ enum_set<T> r = x;
r ^= y;
return r;
}
//! A formatted input function.
- //! \details <b> Effects:</b> Extracts up to \c N characters from is. Stores these characters
+ //! @Effects Extracts up to \c N characters from is. Stores these characters
//! in a temporary object \c str of type <tt>basic_string<charT, traits></tt>, then
- //! evaluates the expression <tt>x = enum_set<EC>(str)</tt>. Characters are extracted
+ //! evaluates the expression <tt>x = enum_set<T>(str)</tt>. Characters are extracted
//! and stored until any of the following occurs:
//! - \c N characters have been extracted and stored;
//! - end-of-file occurs on the input sequence;
@@ -390,27 +487,33 @@
//! (in which case the input character is not extracted).\n
//! If no characters are stored in \c str, calls \c is.setstate(ios_base::failbit)
//! (which may throw <tt>ios_- base::failure</tt>).
- //! \param is the input stream.
- //! \param x the \c enum_set.
- //! \returns \c is.
+ //! @Params
+ //! @Param{is, the input stream}
+ //! @Param{x, the \c enum_set}
+ //! @Returns \c is.
- template <class charT, class ch_traits, typename EC/*, typename Traits*/ >
- std::basic_istream<charT, ch_traits>&
- operator>>(std::basic_istream<charT, ch_traits>& is, enum_set<EC/*,Traits*/>& x)
+ template <class charT, class traits, typename T >
+ std::basic_istream<charT, traits>&
+ operator>>(std::basic_istream<charT, traits>& is, enum_set<T>& x)
{
return is >> x.detail_bits();
}
- //! A formatted output function.
+ //! A formatted output function.
- //! \param os the output stream.
- //! \param x the \c enum_set.
- //! \returns <tt>os << x.template to_string<charT,traits,allocator<charT> >(
- //! use_facet<ctype<charT> >(os.getloc()).widen('0'),
- //! use_facet<ctype<charT> >(os.getloc()).widen('1'))</tt>
- template <class charT, class ch_traits, typename EC/*, typename Traits*/ >
- std::basic_ostream<charT, ch_traits>&
- operator<<(std::basic_ostream<charT, ch_traits>& os, const enum_set<EC/*,Traits*/>& x)
+ //! @Params
+ //! @Param{os, the output stream}
+ //! @Param{x, the \c enum_set}
+ //! @Returns the result of the following expression
+ //! @code
+ //! os << x.template to_string<charT,traits,allocator<charT> >(
+ //! use_facet<ctype<charT> >(os.getloc()).widen('0'),
+ //! use_facet<ctype<charT> >(os.getloc()).widen('1')
+ //! )
+ //! @endcode
+ template <class charT, class traits, typename T >
+ std::basic_ostream<charT, traits>&
+ operator<<(std::basic_ostream<charT, traits>& os, const enum_set<T>& x)
{
return os << x.detail_bits();
}
@@ -418,16 +521,19 @@
} /* namespace enums */
- //! hash template specialization
+ //! enum_set hash template specialization
- template <typename EC/*, typename Traits*/ >
- struct hash<enums::enum_set<EC/*,Traits*/> >
- : public std::unary_function<enums::enum_set<EC/*,Traits*/>, std::size_t>
+ template <typename T >
+ struct hash<enums::enum_set<T> >
+ : public std::unary_function<enums::enum_set<T>, std::size_t>
{
- //! \details the template specialization meets the requirements of class template \c hash.
- std::size_t operator()(const enums::enum_set<EC/*,Traits*/>& bs) const
+ //! \details The template specialization meets the requirements of class template \c hash.
+ //! @Params
+ //! @Param{es, the @c enum_set}
+ //! @Returns the hash associated to the underlying bitset.
+ std::size_t operator()(const enums::enum_set<T>& es) const
{
- return hash<std::bitset<enums::meta::size<EC>::size> >(bs.detail_bits());
+ return hash<std::bitset<enums::meta::size<T>::size> >(es.detail_bits());
}
};
Modified: sandbox/enums/boost/enums/ordinal/first.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/first.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/first.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -33,8 +33,8 @@
//! ordinal enum first.
- //! @return the the first element of an enumeration
- //! @throw Nothing
+ //! @Returns the the first element of an enumeration
+ //! @NoThrow
template <typename EC>
BOOST_CONSTEXPR EC first()
{
Modified: sandbox/enums/boost/enums/ordinal/last.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/last.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/last.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -40,8 +40,8 @@
//! ordinal enum last.
- //! @return the the last element of an enumeration
- //! @throw Nothing
+ //! @Returns the the last element of an enumeration
+ //! @NoThrow
template <typename EC>
BOOST_CONSTEXPR EC last()
{
Modified: sandbox/enums/boost/enums/ordinal/linear_traiter.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/linear_traiter.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/linear_traiter.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -22,8 +22,8 @@
#include <boost/conversion/convert_to.hpp>
/*!
- \file
- \brief
+ @file
+ @brief
The header \c <boost/enums/linear_enum_traiter.hpp> declares a class template
\c meta::linear_enum_traiter<> which can be used as \c enum_trait<> helper for enumerations having a linear progression.
*/
@@ -31,7 +31,7 @@
namespace boost {
namespace enums {
- //! Helper class used as \c enum_trait<> for enumerations having a linear progression.
+ //! Helper class used as \c enum_trait<> for enumerations having a linear progression.
template <
typename EC
>
@@ -50,7 +50,7 @@
public:
//! pos specialization.
- //! \returns the returned value is calculated from the underlying value,
+ //! @Rreturns the returned value is calculated from the underlying value,
//! the \c first_value and the \c step, following this formula \c (ut-first_value)/step
static std::size_t pos(EC e)
{
@@ -59,7 +59,7 @@
}
//! val specialization.
- //! \returns the returned value is calculated from the position \c p,
+ //! @Returns the returned value is calculated from the position \c p,
//! the first value and the step, following this formula \c p*step+first_value
static EC val(std::size_t p)
{
Modified: sandbox/enums/boost/enums/ordinal/pos.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/pos.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/pos.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -35,15 +35,16 @@
//! meta-function used to associate an element of an enumeration to
//! its relative position.
- //! @note This meta-function must be specialized for each element of the enumeration.
+ //! @Note This meta-function must be specialized for each element of the enumeration.
template <typename EC, typename native_type<EC>::type V>
#ifndef BOOST_ENUMS_DOXYGEN_INVOKED
struct pos;
#else
struct pos
{
- //! The nested @c value to be defined for each specialization.
- constexpr std::size_t value=<to be defined for each specialization>;
+ //! The nested @c value to be defined for each scoped enum
+ //! specialization.
+ constexpr std::size_t value=<to be defined for each specialization>;
};
#endif
}
@@ -54,9 +55,10 @@
//! The @c enum_traits class must be specialized and contain a @c pos function
//! that returns the relative position of its argument @c e.
- //! @param e the enum literal
- //! @returns the associated position
- //! @throws Nothing
+ //! @Params
+ //! @Param{e,the enum literal}
+ //! @Returns the associated position
+ //! @No_Throw
template <typename EC>
std::size_t pos(EC e)
{
Modified: sandbox/enums/boost/enums/ordinal/pred.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/pred.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/pred.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -34,7 +34,7 @@
{
//! meta-function that gets the predecessor of an enumeration element.
- //! @pre: the position must be not 0.
+ //! @Requires the position must be not 0.
template <typename EC, typename native_type<EC>::type V>
struct pred
{
@@ -46,8 +46,8 @@
//! ordinal enum predecesor.
- //! @return the predecessor of the enumeration element.
- //! @throw Invalid parameter if the position is 0.
+ //! @Returns the predecessor of the enumeration element.
+ //! @Throw Invalid parameter if the position is 0.
template <typename EC>
BOOST_CONSTEXPR EC pred(EC e)
{
Modified: sandbox/enums/boost/enums/ordinal/size.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/size.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/size.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -28,7 +28,7 @@
namespace meta {
//! meta-function used to get the number of elements of an enumeration.
- //! @note This meta-function must be specialized for each enumeration.
+ //! @Note This meta-function must be specialized for each enumeration.
template <typename EC>
#ifndef BOOST_ENUMS_DOXYGEN_INVOKED
struct size;
@@ -40,8 +40,8 @@
};
#endif
}
- //! @return the number of elements of an enumeration @c EC.
- //! @throw Nothing.
+ //! @Returns the number of elements of an enumeration @c EC.
+ //! @NoThrow
template <typename EC>
std::size_t size()
{
Modified: sandbox/enums/boost/enums/ordinal/succ.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/succ.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/succ.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -11,8 +11,8 @@
//////////////////////////////////////////////////////////////////////////////
/*!
- \file
- \brief
+ @file
+ @brief
The header \c <boost/enums/succ.hpp> declares a class template \c meta::succ<> and
a function \c succ() returning the predecessor of the enumeration element.
*/
@@ -34,7 +34,7 @@
{
//! meta-function that gets the successor of an enumeration element.
- //! @pre the position must not be the last one
+ //! @Requires the position must not be the last one
template <typename EC, typename native_type<EC>::type V>
struct succ
{
@@ -46,10 +46,11 @@
//! enum succesor.
-
- //! param e the enum literal.
- //! @returns the successor of the enumeration element.
- //! @throws Invalid parameter if the position is the last one.
+
+ //! @Params
+ //! @Param{e,the enum literal}
+ //! @Returns the successor of the enumeration element.
+ //! @Throws Invalid parameter if the position is the last one.
template <typename EC>
EC succ(EC e)
{
Modified: sandbox/enums/boost/enums/ordinal/val.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/val.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/val.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -33,7 +33,7 @@
{
//! meta-function used to associate the position to an element of an enumeration.
- //! @note This meta-function must be specialized for each position of the enumeration,
+ //! @Note This meta-function must be specialized for each position of the enumeration,
//! starting from 0 to the predecessor of the size of the enumeration .
template <typename EC, std::size_t I>
#ifndef BOOST_ENUMS_DOXYGEN_INVOKED
@@ -41,7 +41,8 @@
#else
struct val
{
- //! The nested @c value to be defined for each specialization.
+ //! The nested @c value to be defined for each scoped enum
+ //! specialization.
constexpr typename native_type<EC>::type value=<to be defined for each specialization>;
};
#endif
@@ -49,7 +50,8 @@
}
//! ordinal enum value
- //! @param p the position
+ //! @Params
+ //! @Param{p,the position}
//! @returns The enum class element associated to the position @c p.
//! @throws std::out_of_range if the position is out of range.
template <typename EC>
Modified: sandbox/enums/boost/enums/pp/enum_declaration.hpp
==============================================================================
--- sandbox/enums/boost/enums/pp/enum_declaration.hpp (original)
+++ sandbox/enums/boost/enums/pp/enum_declaration.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -91,13 +91,13 @@
@brief Generates a @c boost::enums::meta::size specialization.
- <b>Warning</b>: This macro is presented here for exposition only reasons and is not part of the interface.
+ @Remark This macro is presented here for exposition only reasons and is not part of the interface.
- <b>Parameters</b>:
- - NS_EC, the @p NAMESPACES_CLASS sequence
- - EL, the @p ENUMERATOR_LIST sequence
-
- <b>Result</b>:
+ @Params
+ @Param{NS_EC, the @p NAMESPACES_CLASS sequence}
+ @Param{EL, the @p ENUMERATOR_LIST sequence}
+
+ @Result
@code
template <>
struct size<BOOST_ENUMS_NAMESPACES_CLASS_QNAME(NS_EC)>
@@ -125,15 +125,15 @@
@brief Generates a @c boost::enums::meta::pos/val specialization.
- <b>Warning</b>: This macro is presented here for exposition only reasons and is not part of the interface.
+ @Remark This macro is presented here for exposition only reasons and is not part of the interface.
- <b>Parameters</b>:
- - P: NOT USED
- - QNAME, the @p NAMESPACES_CLASS qualified name
- - P: the position in the ENUMERATOR_LIST sequence
- - ED, the ENUMERATOR_DEFINITION sequence
+ @Params
+ @Param{P,NOT USED}
+ @Param{QNAME,the @p NAMESPACES_CLASS qualified name}
+ @Param{P,the position in the @c ENUMERATOR_LIST sequence}
+ @Param{ED, the @c ENUMERATOR_DEFINITION sequence}
- <b>Result</b>:
+ @Result
@code
template <>
struct pos<QNAME, QNAME :: BOOST_ENUMS_ENUMERATOR_DEFINITION_ID(ED)>
@@ -170,12 +170,13 @@
@brief Generates the enum_trait specialization.
- <b>Warning</b>: This macro is presented here for exposition only reasons and is not part of the interface.
+ @Remark This macro is presented here for exposition only reasons and is not part of the interface.
+
+ @Params
+ @Param{NS_EC, the @c NAMESPACES_CLASS sequence}
+ @Param{TRAITER,the enum traiter template class}
- <b>Parameters</b>:
- - NS_EC, the NAMESPACES_CLASS sequence
- - TRAITER: the enum traiter template class
- <b>Result</b>:
+ @Result
@code
template <>
struct enum_traits<BOOST_ENUMS_NAMESPACES_CLASS_QNAME(NS_EC)>
@@ -195,12 +196,12 @@
@brief Generates all the needed specialization associated to an ordinal scoped enum.
- <b>Warning</b>: This macro is presented here for exposition only reasons and is not part of the interface.
+ @Remark This macro is presented here for exposition only reasons and is not part of the interface.
- <b>Parameters</b>:
- - NS_EC, the NAMESPACES_CLASS sequence
- - TRAITER: the enum traiter template class
- <b>Result</b>:
+ @Params
+ @Param{NS_EC,the @c NAMESPACES_CLASS sequence}
+ @Param{TRAITER,the enum traiter template class}
+ @Result
@code
namespace boost {
namespace enums {
@@ -238,13 +239,13 @@
@brief Generates all the needed definition associated to an ordinal scoped enum type with string conversions and constructors.
- <b>Parameters</b>:
- - NS_EC: the NAMESPACES_CLASS sequence
- - UT: the underlying type
- - EL: the ENUMERATOR_LIST sequence
- - TRAITER: the enum traiter template class
+ @Params
+ @Param{NS_EC, the @c NAMESPACES_CLASS sequence}
+ @Param{UT,the underlying type}
+ @Param{EL,the @c ENUMERATOR_LIST sequence}
+ @Param{TRAITER,the enum traiter template class}
- <b>Result</b>:
+ @Result
@code
BOOST_ENUM_NS_TYPE_START(NS_EC, UT)
{
@@ -270,17 +271,17 @@
@brief Generates all the needed definition associated to an ordinal scoped enum type with string conversions and without constructors.
- <b>Parameters</b>:
- - NS_EC: the NAMESPACES_CLASS sequence
- - UT: the underlying type
- - EL: the ENUMERATOR_LIST sequence
- - TRAITER: the enum traiter template class
+ @Params
+ @Param{NS_EC, the @c NAMESPACES_CLASS sequence}
+ @Param{UT,the underlying type}
+ @Param{EL,the @c ENUMERATOR_LIST sequence}
+ @Param{TRAITER,the enum traiter template class}
- <b>Result</b>:
+ @Result
@code
BOOST_ENUM_NS_TYPE_START(NS_EC, UT)
{
- BOOST_ENUMS_ENUMERATOR_LIST_GENERATE(EL)
+ BOOST_ENUMS_ENUMERATOR_LIST_GENERATE(EL)
}
BOOST_ENUM_NS_TYPE_NO_CONS_END(NS_EC, UT)
BOOST_ENUMS_ENUM_DCL_SPE(NS_EC, EL, TRAITER)
@@ -301,17 +302,17 @@
@brief Generates all the needed definition associated to an ordinal scoped enum class with string conversions and with constructors.
- <b>Parameters</b>:
- - NS_EC: the NAMESPACES_CLASS sequence
- - UT: the underlying type
- - EL: the ENUMERATOR_LIST sequence
- - TRAITER: the enum traiter template class
+ @Params
+ @Param{NS_EC, the @c NAMESPACES_CLASS sequence}
+ @Param{UT,the underlying type}
+ @Param{EL,the @c ENUMERATOR_LIST sequence}
+ @Param{TRAITER,the enum traiter template class}
- <b>Result</b>:
+ @Result
@code
BOOST_ENUM_NS_CLASS_START(NS_EC, UT)
{
- BOOST_ENUMS_ENUMERATOR_LIST_GENERATE(EL)
+ BOOST_ENUMS_ENUMERATOR_LIST_GENERATE(EL)
}
BOOST_ENUM_NS_CLASS_CONS_END(NS_EC, UT)
BOOST_ENUMS_ENUM_DCL_SPE(NS_EC, EL, TRAITER)
@@ -333,17 +334,17 @@
@brief Generates all the needed definition associated to an ordinal scoped enum class with string conversions and without constructors.
- <b>Parameters</b>:
- - NS_EC: the NAMESPACES_CLASS sequence
- - UT: the underlying type
- - EL: the ENUMERATOR_LIST sequence
- - TRAITER: the enum traiter template class
+ @Params
+ @Param{NS_EC, the @c NAMESPACES_CLASS sequence}
+ @Param{UT,the underlying type}
+ @Param{EL,the @c ENUMERATOR_LIST sequence}
+ @Param{TRAITER,the enum traiter template class}
- <b>Result</b>:
+ @Result
@code
BOOST_ENUM_NS_CLASS_START(NS_EC, UT)
{
- BOOST_ENUMS_ENUMERATOR_LIST_GENERATE(EL)
+ BOOST_ENUMS_ENUMERATOR_LIST_GENERATE(EL)
}
BOOST_ENUM_NS_CLASS_NO_CONS_END(NS_EC, UT)
BOOST_ENUMS_ENUM_DCL_SPE(NS_EC, EL, TRAITER)
Modified: sandbox/enums/boost/enums/pp/enumerator_definition.hpp
==============================================================================
--- sandbox/enums/boost/enums/pp/enumerator_definition.hpp (original)
+++ sandbox/enums/boost/enums/pp/enumerator_definition.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -23,27 +23,24 @@
/** @file
- @brief ENUMERATOR_DEFINITION data type and macros.
+ @brief @c ENUMERATOR_DEFINITION data type and macros.
@details
- An ENUMERATOR_DEFINITION is a sequence legth 1, 2 or 3 where
+ An @c ENUMERATOR_DEFINITION is a sequence legth 1, 2 or 3 where
- the fist element is a C++ identifier,
- the second is a C++ constant-expression and
- the 3rd a C++ string literal
- <b>Examples</b>:
+ @Example:
@code
(Red)
(Green)(0)
(Blue)(2)("Azul")
@endcode
- All the operations are named BOOST_ENUMS_ENUMERATOR_DEFINITION_:
- - ID : ED -> first element
- - VAL : ED, DEF -> second element or DEF
- - STR : ED -> third element or "ID"
+ All the operations are named @c BOOST_ENUMS_ENUMERATOR_DEFINITION_:
*/
@@ -51,10 +48,10 @@
@brief This macro is used to get the identifier from a ENUMERATOR_DEFINITION.
- <b>Parameters</b>:
- - ED: the ENUMERATOR_DEFINITION
-
- <b>Result</b>: the first element of @p ED.
+ @Params
+ @Param{ED,the @c ENUMERATOR_DEFINITION}
+
+ @Result the first element of @p ED.
*/
@@ -75,11 +72,11 @@
@brief This macro is used to get the constant-expression from a ENUMERATOR_DEFINITION.
- <b>Parameters</b>:
- - ED: the ENUMERATOR_DEFINITION }
- - DEFAULT: the default value when there is no second element.
+ @Params
+ @Param{ED,the @c ENUMERATOR_DEFINITION}
+ @Param{DEFAULT,the default value when there is no second element}
- <b>Result</b>: the second element of the @p ED or @p DEFAULT.
+ @Result the second element of the @p ED or @p DEFAULT.
*/
#define BOOST_ENUMS_ENUMERATOR_DEFINITION_VAL(ED,DEFAULT) \
@@ -102,10 +99,10 @@
@brief This macro is used to get the string literal from a ENUMERATOR_DEFINITION.
- <b>Parameters</b>:
- - ED, the ENUMERATOR_DEFINITION.
+ @Params
+ @Param{ED,the @c ENUMERATOR_DEFINITION}
- <b>Result</b>: the third element of @p ED or the string representation of ED'ID.
+ @Result the third element of @p ED or the string representation of ED'ID.
*/
#define BOOST_ENUMS_ENUMERATOR_DEFINITION_STR(ED) \
@@ -127,11 +124,10 @@
@brief This macro is used to get the constant-expression from a ENUMERATOR_DEFINITION.
- <b>Parameters</b>:
- - ED: the ENUMERATOR_DEFINITION }
- - DEFAULT: the default value when there is no second element.
+ @Params
+ @Param{ED,the @c ENUMERATOR_DEFINITION}
- <b>Result</b>: the second element of the @p ED or @p DEFAULT.
+ @Result the second element of the @p ED or @p DEFAULT.
*/
#define BOOST_ENUMS_ENUMERATOR_DEFINITION_OPT_ASSIGN_VAL(ED) \
@@ -146,16 +142,16 @@
@brief generates a enumerator_definition from a ENUMERATOR_DEFINITION.
- <b>Parameters</b>:
- - ED, the ENUMERATOR_DEFINITION
- - DEFAULT: the default value when there is no second element.
+ @Params
+ @Param{ED,the @c ENUMERATOR_DEFINITION}
+ @Param{DEFAULT,the default value when there is no second element}
- <b>Result</b>:
+ @Result
@code
ID(ED) [= VAL(ED)]
@endcode
- <b>Note</b>: The optional part is generated if there is a second element.
+ @Note The optional part is generated if there is a second element.
*/
#define BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION(ED) \
Modified: sandbox/enums/boost/enums/pp/namespaces.hpp
==============================================================================
--- sandbox/enums/boost/enums/pp/namespaces.hpp (original)
+++ sandbox/enums/boost/enums/pp/namespaces.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -13,26 +13,26 @@
/** @file
- @brief NAMESPACES, NAMESPACES_CLASS data types and macros.
+ @brief @c NAMESPACES, @c NAMESPACES_CLASS PP data types and macros.
@details
- A NAMESPACES is a variable sequence of namespace identifiers.
+ A @c NAMESPACES is a variable sequence of namespace identifiers.
- <b>Example</b>:
+ @Example
@code
(NS1)(NS2)
@endcode
- A NAMESPACES_CLASS is a variable sequence of namespace identifiers followed by a class identifier.
+ A @c NAMESPACES_CLASS is a variable sequence of namespace identifiers followed by a class identifier.
- <b>Example</b>:
+ @Example
@code
(NS1)(NS2)(ENUM)
@endcode
- All the operations are named BOOST_ENUMS_NAMESAPCES_ or BOOST_ENUMS_NAMESAPCES_CLASS.
+ All the operations are prefixed by @c BOOST_ENUMS_NAMESAPCES_ or @c BOOST_ENUMS_NAMESAPCES_CLASS.
*/
@@ -49,12 +49,12 @@
/**
- @brief Get the NAMESPACES part of a NAMESPACES_CLASS.
+ @brief Get the @c NAMESPACES part of a @c NAMESPACES_CLASS.
- <b>Parameters</b>:
- - SEQ: the NAMESPACES_CLASS
+ @Params
+ @Param{SEQ,the @c NAMESPACES_CLASS}
- <b>Result</b>: the NAMESPACES part.
+ @Result the @c NAMESPACES part.
*/
@@ -64,12 +64,12 @@
/**
- @brief Get the CLASS part of a NAMESPACES_CLASS.
+ @brief Get the CLASS part of a @c NAMESPACES_CLASS.
- <b>Parameters</b>:
- - SEQ: the NAMESPACES_CLASS
+ @Params
+ @Param{SEQ,the @c NAMESPACES_CLASS}
- <b>Result</b>: the CLASS part.
+ @Result the @c CLASS part.
*/
@@ -79,12 +79,12 @@
/**
- @brief Generate the opening of the namespaces in NAMESPACES.
+ @brief Generate the opening of the namespaces in @c NAMESPACES.
- <b>Parameters</b>:
- - SEQ: the NAMESPACES sequence
+ @Params
+ @Param{SEQ,the @c NAMESPACES sequence}
- <b>Result</b>:
+ @Result
@code
namespace NS1 { ... namespace NSn {
@endcode
@@ -100,12 +100,12 @@
/**
- @brief Generate the closing of the namespaces in NAMESPACES.
+ @brief Generate the closing of the namespaces in @c NAMESPACES.
- <b>Parameters</b>:
- - SEQ: the NAMESPACES sequence
+ @Params
+ @Param{SEQ,the @c NAMESPACES sequence}
- <b>Result</b>:
+ @Result
@code
} ... }
@endcode
@@ -128,12 +128,12 @@
/**
- @brief the qualified name associated to NAMESPACES_CLASS.
+ @brief the qualified name associated to @c NAMESPACES_CLASS.
- <b>Parameters</b>:
- - SEQ: the NAMESPACES_CLASS sequence
+ @Params
+ - SEQ: the @c NAMESPACES_CLASS sequence
- <b>Result</b>:
+ @Result
@code
NS1::...NSn::ENUM
@endcode
Modified: sandbox/enums/boost/enums/scoped/default_value.hpp
==============================================================================
--- sandbox/enums/boost/enums/scoped/default_value.hpp (original)
+++ sandbox/enums/boost/enums/scoped/default_value.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -19,8 +19,15 @@
namespace enums {
//! builds a enum class with the default value.
-
- //! \return the default value
+
+ //! This function is usefult to make programs portable when the scoped enum
+ //! emulation doesn't defines a default constructor.
+ //! @TParams
+ //! @Param{EC,the scoped enum type}
+
+ //! @Returns the default value as if the default constructor of @c EC was defined.
+ //! @NoThrow
+ //! @Note The use of @c EC() will let the underlying storage uninitialized when constructors are not defined by the emulation.
template <typename EC>
inline EC default_value()
{
Modified: sandbox/enums/boost/enums/scoped/enum_class_cons.hpp
==============================================================================
--- sandbox/enums/boost/enums/scoped/enum_class_cons.hpp (original)
+++ sandbox/enums/boost/enums/scoped/enum_class_cons.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -11,8 +11,8 @@
//////////////////////////////////////////////////////////////////////////////
/*!
- \file
- \brief
+ @file
+ @brief
The header \c <boost/enums/scoped/enum_class_cons.hpp> defines the declaration of enum_class_cons<> template class.
*/
@@ -30,51 +30,76 @@
{
namespace enums
{
- //! scoped enum class with constructors
-
- //! param @c ScopedEnum : Struct scoping the enum.\n
- //! param @c UT : the underlaying storage type.\n
- //! pre @c ScopedEnum must have a nested C++98 enum @c type.\n
+ //! Scoped enum class with constructors.
+ //!
+ //! @TParams
+ //! @Param{ScopedEnum,Struct scoping the enumerators}
+ //! @Param{UT,the underlaying storage type}
+ //! @Requires @c ScopedEnum must have a nested C++98 enum @c type.
+ //!
+ //! @c enum_class_cons wraps the underlying type @c UT providing only the
+ //! needed constructors, explicit conversion operations and comparison operators.
+ //! The inheritance to a scoping struct @ScopedEnum mak available the scoped
+ //! enumerators as if they where defined here.
+ //!
+ //! This class is not implicitly convertible to the underlying type,
+ //! neither to the enum type. Explicit conversion can be done using @c
+ //! underlying_value<>(e), @c native_value<>(e) or the @c converto_to<>(e).
+ //! @Note This class can not be used inside a union with compilers that donesn't support unrestricted unions.
template <typename ScopedEnum, typename UT=int>
class enum_class_cons : public ScopedEnum
{
public:
- //! c++98 enum type
+ //! c++98 native enum type
typedef typename ScopedEnum::type type;
//! underlying type
typedef UT underlying_type;
private:
+ //! storage for exposition only
underlying_type val_;
public:
- //! default constructor
+ //! default construct
+
+ //! @Effects As if it was initialized using the default constructor of the native enum type.
+ //! @Post type(this->val_) == type()
enum_class_cons()
: val_(static_cast<underlying_type>(type()))
{
}
//! explicit constructor from underlying type
+ //! @Post val_ == v
explicit enum_class_cons(underlying_type v)
: val_(v)
{
}
//! constructor from enum type
+ //! @Post type(val_) == v
enum_class_cons(type v)
: val_(static_cast<underlying_type>(v))
{
}
//! assignment
+ //! @Post val_ == rhs.val_
+ //! @Returns @c *this
enum_class_cons& operator=(enum_class_cons rhs)
{
val_=rhs.val_;
return *this;
}
//! assignment from enum literals
+ //! @Post type(val_) == rhs.val_
+ //! @Returns @c *this
enum_class_cons& operator=(type rhs)
{
val_=static_cast<underlying_type>(rhs);
return *this;
}
- //! workaround when there are no constructors
+
+ //! default_value builder
+ //!
+ //! This function is provided to be uniform with scoped enums with no constructors.
+ //! @Returns @c EC().
static enum_class_cons default_value()
{
enum_class_cons res;
@@ -82,121 +107,137 @@
return res;
}
- static enum_class_cons convert_to(underlying_type v)
- {
- enum_class_cons res;
- res.val_=v;
- return res;
-
- }
- static enum_class_cons convert_to(type v)
- {
- enum_class_cons res;
- res.val_=static_cast<underlying_type>(v);
- return res;
- }
//! explicit conversion function to enum type
+
+ //! @Returns @c type(val_).
type native_value() const
{
return type(val_);
}
//! explicit conversion function to underlying_type
+
+ //! @Returns @c val_.
underlying_type underlying_value() const
{
return val_;
}
//! equal operator
+
+ //! @Returns <tt>lhs.val_ == rhs.val_</tt>.
friend bool operator==(enum_class_cons lhs, enum_class_cons rhs)
{
return lhs.val_ == rhs.val_;
}
//! equal operator
+ //! @Returns <tt>lhs == rhs.val_</tt>.
friend bool operator==(type lhs, enum_class_cons rhs)
{
return lhs == rhs.val_;
}
//! equal operator
+
+ //! @Returns <tt>lhs.val_ == rhs</tt>.
friend bool operator==(enum_class_cons lhs, type rhs)
{
return lhs.val_ == rhs;
}
//! not_equal operator
+ //! @Returns <tt>lhs.val_ != rhs.val_</tt>.
+
friend bool operator!=(enum_class_cons lhs, enum_class_cons rhs)
{
return lhs.val_ != rhs.val_;
}
//! not_equal operator
+
+ //! @Returns <tt>lhs != rhs.val_</tt>.
friend bool operator!=(type lhs, enum_class_cons rhs)
{
return lhs != rhs.val_;
}
//! not_equal operator
+
+ //! @Returns <tt>lhs.val_ != rhs</tt>.
friend bool operator!=(enum_class_cons lhs, type rhs)
{
return lhs.val_ != rhs;
}
//! less_equal operator
+ //! @Returns <tt>lhs.val_ <= rhs.val_</tt>.
friend bool operator<=(enum_class_cons lhs, enum_class_cons rhs)
{
return lhs.val_ <= rhs.val_;
}
//! less_equal operator
+ //! @Returns <tt>lhs <= rhs.val_</tt>.
friend bool operator<=(type lhs, enum_class_cons rhs)
{
return lhs <= rhs.val_;
}
//! less_equal operator
+ //! @Returns <tt>lhs.val_ <= rhs</tt>.
friend bool operator<=(enum_class_cons lhs, type rhs)
{
return lhs.val_ <= rhs;
}
//! less operator
+ //! @Returns <tt>lhs.val_ < rhs.val_</tt>.
friend bool operator<(enum_class_cons lhs, enum_class_cons rhs)
{
return lhs.val_ < rhs.val_;
}
//! less operator
+ //! @Returns <tt>lhs <= rhs.val_</tt>.
friend bool operator<(type lhs, enum_class_cons rhs)
{
return lhs < rhs.val_;
}
//! less operator
+ //! @Returns <tt>lhs.val_ <= rhs</tt>.
friend bool operator<(enum_class_cons lhs, type rhs)
{
return lhs.val_ < rhs;
}
//! greater_equal operator
+ //! @Returns <tt>lhs.val_ >= rhs.val_</tt>.
friend bool operator>=(enum_class_cons lhs, enum_class_cons rhs)
{
return lhs.val_ >= rhs.val_;
}
//! greater_equal operator
+ //! @Returns <tt>lhs >= rhs.val_</tt>.
friend bool operator>=(type lhs, enum_class_cons rhs)
{
return lhs >= rhs.val_;
}
//! greater_equal operator
+ //! @Returns <tt>lhs.val_ >= rhs</tt>.
friend bool operator>=(enum_class_cons lhs, type rhs)
{
return lhs.val_ >= rhs;
}
//! greater operator
+ //! @Returns <tt>lhs.val_ > rhs.val_</tt>.
friend bool operator>(enum_class_cons lhs, enum_class_cons rhs)
{
return lhs.val_ > rhs.val_;
}
//! greater operator
+ //! @Returns <tt>lhs > rhs.val_</tt>.
friend bool operator>(type lhs, enum_class_cons rhs)
{
return lhs > rhs.val_;
}
//! greater operator
+ //! @Returns <tt>lhs.val_ > rhs</tt>.
friend bool operator>(enum_class_cons lhs, type rhs)
{
return lhs.val_ > rhs;
}
//! conversions from enum_type_cons to underlying_type following the Boost.Conversion protocol
+
+ //! @Returns <tt>boost::enums::underlying_value(v)</tt>.
friend underlying_type convert_to(enum_class_cons v,
boost::dummy::type_tag<underlying_type> const&)
{
@@ -204,6 +245,8 @@
}
//! conversions from enum_type_cons to type following the Boost.Conversion protocol
+
+ //! @Returns <tt>boost::enums::native_value(v)</tt>.
friend type convert_to(enum_class_cons v,
boost::dummy::type_tag<type> const&)
{
Modified: sandbox/enums/boost/enums/scoped/native_value.hpp
==============================================================================
--- sandbox/enums/boost/enums/scoped/native_value.hpp (original)
+++ sandbox/enums/boost/enums/scoped/native_value.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -19,6 +19,17 @@
namespace boost {
namespace enums {
+ //! gets the native enum value.
+
+ //! This function is useful to make programs portable when the scoped enum
+ //! emulation can not be use where native enums can.
+ //! @TParams
+ //! @Param{EC,the scoped enum type}
+
+ //! @Params
+ //! @Param{e,the scoped enum}
+ //! @Returns the native enum value.
+ //! @NoThrow
template <typename EC>
inline
typename native_type<EC>::type native_value(EC e)
Modified: sandbox/enums/boost/enums/scoped/scoping_type.hpp
==============================================================================
--- sandbox/enums/boost/enums/scoped/scoping_type.hpp (original)
+++ sandbox/enums/boost/enums/scoped/scoping_type.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -27,24 +27,29 @@
{
namespace meta
{
- /*! meta-function to be specialized for each emulated enum class.
- */
+ //! meta-function to be specialized for each emulated enum class.
+
+ //! <b>Requires</b> \c EC must be an enum type or the emulation of a scoped enum.\n\n
template <typename EC_type>
struct scoping_type
{
- //! By default this metafunction defines it as if scoped enums where supported.
+
+ //! By default this metafunction defines it as if scoped enums where
+ //! supported.
typedef EC_type type;
};
}
- /*! Get the wrapping class of an enum when emulation
- is used or the enum class itself when available.
-
- @note This meta-function must be specialized for each enum class.
- */
+ //! Get the wrapping class of an enum when emulation
+ //! is used or the enum class itself when available.
+ //!
+ //! @Note This meta-function must be specialized for each enum class.
+ //! @Requires \c EC must be an enum type or the emulation of a scoped enum.\n\n
template <typename EC_type>
struct scoping_type
{
- //! Depending on whethere the compiler supports scoped enums or not the nested type must be the same type or the emulated one.
+
+ //! Depending on whethere the compiler supports scoped enums or not the
+ //! nested type must be the same type or the emulated one.
typedef typename meta::scoping_type<EC_type>::type type;
};
}
Modified: sandbox/enums/boost/enums/scoped/underlying_type.hpp
==============================================================================
--- sandbox/enums/boost/enums/scoped/underlying_type.hpp (original)
+++ sandbox/enums/boost/enums/scoped/underlying_type.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -25,13 +25,12 @@
namespace meta
{
//! customization-point for underlying type metafunction
-
-
+
+ //! <b>Requires</b> \c EC must be an enum type or the emulation of a scoped enum.\n\n
template <typename EC>
struct underlying_type
{
#ifdef BOOST_ENUMS_DOXYGEN_INVOKED
- //! <b>Requires</b> \c EC must be an enum type or the emulation of a scoped enum.\n\n
//! The member typedef \c type name the underlying type of \c T.
//! When scoped enums are emulated it is defined as \c typename \c EC::underlying_type.
//! Otherwise is defined as \c std::underlying_type<EC>::type.
Modified: sandbox/enums/boost/enums/scoped/underlying_value.hpp
==============================================================================
--- sandbox/enums/boost/enums/scoped/underlying_value.hpp (original)
+++ sandbox/enums/boost/enums/scoped/underlying_value.hpp 2011-03-24 14:20:52 EDT (Thu, 24 Mar 2011)
@@ -19,6 +19,17 @@
namespace boost {
namespace enums {
+ //! gets the underlying value.
+
+ //! This function is useful to when working with scoped enum classes which
+ //! doens't implicitly convert to the underlying type.
+ //! @TParams
+ //! @Param{EC,the scoped enum type}
+
+ //! @Params
+ //! @Param{e,the scoped enum}
+ //! @Returns the underlying value.
+ //! @NoThrow
template <typename EC>
inline
typename underlying_type<EC>::type
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk