You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by vi...@apache.org on 2008/08/01 22:51:22 UTC
svn commit: r681820 [5/7] - in /stdcxx/trunk: ./ doc/ etc/config/src/
examples/include/ include/ include/loc/ include/rw/ src/ tests/containers/
tests/diagnostics/ tests/include/ tests/intro/ tests/localization/
tests/regress/ tests/src/ tests/strings/...
Modified: stdcxx/trunk/include/tuple
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/tuple?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/include/tuple (original)
+++ stdcxx/trunk/include/tuple Fri Aug 1 13:51:17 2008
@@ -1,9 +1,9 @@
// -*- C++ -*-
/***************************************************************************
*
- * tuple - fixed-size collection of values with variable, heterogenous types
+ * tuple - fixed-size collections with variable, heterogenous types
*
- * $Id$
+ * $Id: tuple 677458 2008-07-16 22:49:27Z elemings $
*
***************************************************************************
*
@@ -23,8 +23,8 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 2008 Rogue Wave Software.
- *
+ * Copyright 2008 Rogue Wave Software, Inc.
+ *
**************************************************************************/
#ifndef _RWSTD_TUPLE_INCLUDED
@@ -36,82 +36,270 @@
# error _RWSTD_NO_EXT_CXX_0X defined and C++0x header included
# endif // defined _RWSTD_NO_EXT_CXX_0X
-# include <type_traits>
-
-# include <rw/_ref_wrap.h>
+# include <rw/_forward.h> // for _RWSTD_FORWARD, _RWSTD_MOVE
+# include <rw/_meta_cv.h> // for _RWSTD_ADD_CONST
+# include <rw/_meta_help.h> // for __rw_integral_constant
+# include <rw/_meta_ref.h> // for _RWSTD_ADD_LVALUE_REFERENCE
+# include <rw/_pair.h> // for std::pair
# include <rw/_tuple.h>
-# include <rw/_tuple_traits.h>
+
+# if !defined _RWSTD_NO_VARIADIC_TEMPLATES
-_RWSTD_NAMESPACE (__rw) {
+_RWSTD_NAMESPACE (std) {
-struct __rw_ignore { /* empty */ };
-template <class _Type>
-struct __rw_deduce_reference
+// 20.3.1, class template tuple:
+
+template <class... _TypesT>
+class tuple;
+
+_RWSTD_SPECIALIZED_CLASS
+class tuple<>
{
- typedef _Type type;
+ // empty
};
-template <class _Type>
-struct __rw_deduce_reference< __rw_ref_wrap<_Type> >
+template <class... _TypesT>
+class tuple
+ : public _RW::__rw_tuple<_TypesT...>
{
- typedef _Type& type;
+ typedef _RW::__rw_tuple<_TypesT...> _Base;
+
+# undef _BaseU
+# define _BaseU _RW::__rw_tuple<_TypesU...>
+
+public:
+
+ tuple ()
+ : _Base () { /* empty */ }
+
+ // employ _RWSTD_STATIC_CAST to ensure compiler binds to correct
+ // base class ctors and operators
+
+ tuple (const tuple& __tuple)
+ : _Base (_RWSTD_STATIC_CAST (const _Base&, __tuple)) { /* empty */ }
+
+ tuple& operator= (const tuple& __tuple) {
+ _Base::operator= (_RWSTD_STATIC_CAST (const _Base&, __tuple));
+ return *this;
+ }
+
+ explicit
+ tuple (const _TypesT&... __values)
+ : _Base (__values...) { /* empty */ }
+
+ template <class... _TypesU>
+ tuple (const tuple<_TypesU...>& __tuple)
+ : _Base (_RWSTD_STATIC_CAST (const _BaseU&, __tuple)) { /* empty */ }
+
+ template <class... _TypesU>
+ tuple& operator= (const tuple<_TypesU...>& __tuple) {
+ _Base::operator= (_RWSTD_STATIC_CAST (const _BaseU&, __tuple));
+ return *this;
+ }
+
+# if !defined _RWSTD_NO_RVALUE_REFERENCES
+
+ tuple (tuple&& __tuple)
+ : _Base (_RWSTD_FORWARD (_Base, __tuple)) { /* empty */ }
+
+ tuple& operator= (tuple&& __tuple) {
+ _Base::operator= (_RWSTD_FORWARD (_Base, __tuple));
+ return *this;
+ }
+
+ template <class... _TypesU>
+ explicit tuple (_TypesU&&... __values)
+ : _Base (_RWSTD_FORWARD (_TypesU, __values)...) { /* empty */ }
+
+ template <class... _TypesU>
+ tuple (tuple<_TypesU...>&& __tuple)
+ : _Base (_RWSTD_FORWARD (_BaseU, __tuple)) { /* empty */ }
+
+ template <class... _TypesU>
+ tuple& operator= (tuple<_TypesU...>&& __tuple) {
+ _Base::operator= (_RWSTD_FORWARD (_BaseU, __tuple));
+ return *this;
+ }
+
+ // allocator-extended constructors:
+
+ template <class _Alloc, class... _TypesU>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ const _TypesU&&... __values);
+
+ template <class _Alloc>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ tuple&& __tuple);
+
+ template <class _Alloc, class... _TypesU>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ tuple<_TypesU...>&& __tuple);
+
+# endif // !defined _RWSTD_NO_RVALUE_REFERENCES
+
+# undef _BaseU
+
+ template <class _Alloc>
+ tuple (allocator_arg_t, const _Alloc& __alloc);
+
+ template <class _Alloc>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ const _TypesT&... __values);
+
+ template <class _Alloc>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ const tuple& __tuple);
+
+ template <class _Alloc, class... _TypesU>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ const tuple<_TypesU...>& __tuple);
+
};
-template <class _Type>
-struct __rw_deduce_reference< const __rw_ref_wrap<_Type> >
+
+template <class _TypeT1, class _TypeT2>
+class tuple<_TypeT1, _TypeT2>
+ : public _RW::__rw_tuple<_TypeT1, _TypeT2>
{
- typedef _Type& type;
+ typedef _RW::__rw_tuple<_TypeT1, _TypeT2> _Base;
+
+# undef _BaseU
+# define _BaseU _RW::__rw_tuple<_TypeU1, _TypeU2>
+
+public:
+
+ // 20.3.1.2, construction:
+
+ tuple ()
+ : _Base () { /* empty */ }
+
+ tuple (const tuple& __tuple)
+ : _Base (_RWSTD_STATIC_CAST (const _Base&, __tuple)) { /* empty */ }
+
+ tuple& operator= (const tuple& __tuple) {
+ _Base::operator= (_RWSTD_STATIC_CAST (const _Base&, __tuple));
+ return *this;
+ }
+
+ tuple (const _TypeT1& __x, const _TypeT2& __y)
+ : _Base (__x, __y) { /* empty */ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple (const tuple<_TypeU1, _TypeU2>& __tuple)
+ : _Base (_RWSTD_STATIC_CAST (const _BaseU&, __tuple)) { /* empty */ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple& operator= (const tuple<_TypeU1, _TypeU2>& __tuple) {
+ _Base::operator= (_RWSTD_STATIC_CAST (const _BaseU&, __tuple));
+ return *this;
+ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple (const pair<_TypeU1, _TypeU2>& __pair)
+ : _Base (__pair.first, __pair.second) { /* empty */ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple& operator= (const pair<_TypeU1, _TypeU2>& __pair) {
+ _Base::operator= (__pair.first, __pair.second);
+ return *this;
+ }
+
+# if !defined _RWSTD_NO_RVALUE_REFERENCES
+
+ template <class _TypeU1, class _TypeU2>
+ tuple (_TypeU1&& __x, _TypeU2&& __y)
+ : _Base (_RWSTD_MOVE (__x), _RWSTD_MOVE (__y)) { /* empty */ }
+
+ tuple (tuple&& __tuple)
+ : _Base (_RWSTD_FORWARD (_Base, __tuple)) { /* empty */ }
+
+ tuple& operator= (tuple&& __tuple) {
+ _Base::operator= (_RWSTD_FORWARD (_Base, __tuple));
+ return *this;
+ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple (tuple<_TypeU1, _TypeU2>&& __tuple)
+ : _Base (_RWSTD_FORWARD (_BaseU, __tuple))
+ { /* empty */ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple& operator= (tuple<_TypeU1, _TypeU2>&& __tuple) {
+ _Base::operator= (_RWSTD_FORWARD (_BaseU, __tuple));
+ return *this;
+ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple (pair<_TypeU1, _TypeU2>&& __pair)
+ : _Base (_RWSTD_MOVE (__pair.first),
+ _RWSTD_MOVE ( __pair.second)) { /* empty */ }
+
+ template <class _TypeU1, class _TypeU2>
+ tuple& operator= (pair<_TypeU1, _TypeU2>&& __pair) {
+ _Base::operator= (__pair.first, __pair.second);
+ return *this;
+ }
+
+ // allocator-extended constructors:
+
+ template <class _Alloc, class _TypeU1, class _TypeU2>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ pair<_TypeU1, _TypeU2>&& __pair);
+
+# endif // !defined _RWSTD_NO_RVALUE_REFERENCES
+
+# undef _BaseU
+
+ template <class _Alloc, class _TypeU1, class _TypeU2>
+ tuple (allocator_arg_t, const _Alloc& __alloc,
+ const pair<_TypeU1, _TypeU2>& __pair);
+
};
-/**
- * @internal
- * Transform a tuple element type into a suitable make_tuple() return
- * type.
- * @tparam _Type A tuple element type.
- */
-template <class _Type>
-class __rw_make_tuple
+
+// 20.3.1.1, tuple traits:
+
+template <class _Type, class _Alloc>
+struct uses_allocator;
+
+template <class... _TypesT, class _Alloc>
+struct uses_allocator<tuple<_TypesT...>, _Alloc>
+ : _RW::__rw_true_type
{
- typedef _TYPENAME _RWSTD_DECAY(_Type) _Decay;
- typedef _TYPENAME __rw_deduce_reference<_Decay>::type type;
+ // empty
};
-} // namespace __rw
+template <class _Type>
+struct constructible_with_allocator_prefix;
-_RWSTD_NAMESPACE (std) {
+template <class... _TypesT>
+struct constructible_with_allocator_prefix<tuple<_TypesT...> >
+ : _RW::__rw_true_type
+{
+ // empty
+};
// 20.3.3, tuple creation functions:
const _RW::__rw_ignore ignore = _RW::__rw_ignore ();
-# if !defined _RWSTD_NO_VARIADIC_TEMPLATES
# if !defined _RWSTD_NO_RVALUE_REFERENCES
-/**
- * @function make_tuple
- *
- * Create a new tuple from a list of element values. This function
- * constructs a new tuple from the corresponding element values by
- * utilizing move semantics.
- *
- * @tparam _Types The list of elements types in the tuple.
- * @param __values A corresponding list of element values.
- * @return A tuple object containing the given element values.
- */
-template <class... _Types>
-tuple<_TYPENAME _RW::__rw_make_tuple<_Types>::type...>
-make_tuple (_Types&&... __values)
+template <class... _TypesT>
+inline tuple<typename _RW::__rw_make_tuple<_TypesT>::_C_type...>
+make_tuple (_TypesT&&... __values)
{
- typedef tuple<_TYPENAME _RW::__rw_make_tuple<_Types>::type...> _Tuple;
- return _Tuple (std::forward<_Types> (__values)...);
+ typedef tuple<typename _RW::__rw_make_tuple<_TypesT>::_C_type...> _Tuple;
+ return _Tuple (_RWSTD_FORWARD (_TypesT, __values)...);
}
+
template <class... _TypesT, class... _TypesU>
tuple<_TypesT..., _TypesU...>
tuple_cat (tuple<_TypesT...>&& __x,
@@ -129,86 +317,60 @@
# endif // !defined _RWSTD_NO_RVALUE_REFERENCES
-template <class... _Types>
-tuple<_Types&...> tie (_Types&...);
-
template <class... _TypesT, class... _TypesU>
tuple<_TypesT..., _TypesU...>
tuple_cat (const tuple<_TypesT...>& __x,
const tuple<_TypesU...>& __y);
-// 20.3.1.4, tuple helper classes:
+template <class... _TypesT>
+inline tuple<_TypesT&...>
+tie (_TypesT&... __values)
+{
+ return tuple<_TypesT&...> (__values...);
+}
-/**
- * @class tuple_size
- *
- * Determine number of element types in tuple. This compile-time
- * integral constant wrapper determines the number of element types in
- * a tuple. The class template is ill-formed for any non-tuple typle.
- *
- * @tparam Types List of element types in tuple.
- */
-template <class Types>
+// 20.3.1.4, tuple helper classes:
+
+template <class _TypesT>
class tuple_size;
-template <class... _Types>
-class tuple_size< tuple<_Types...> >
+template <class... _TypesT>
+class tuple_size< tuple<_TypesT...> >
: public _RW::__rw_integral_constant< _RWSTD_SIZE_T,
- sizeof... (_Types) >
+ sizeof... (_TypesT) >
{
// empty
};
-/**
- * @class tuple_element
- *
- * Determine the Nth element type of a tuple. Instances of this class
- * class template provide a type member that identifies the Nth element
- * type of a tuple \c T where 0 <= N <
- * <code>tuple_size<T>::value</code>. If N is not in this range
- * or for any other arbitrary type, the program is ill-formed.
- *
- * @tparam Index An integer constant indicating the Nth element type.
- * @tparam Types List of element types in the tuple.
- */
-
-template <int Index, class... Types>
+template <_RWSTD_SIZE_T _Index, class... _TypesT>
struct tuple_element;
template <class _Head, class... _Tail>
struct tuple_element<0, tuple<_Head, _Tail...> >
{
- /** The Nth element type of the tuple. */
typedef _Head type;
+//internal:
- typedef tuple<_Head, _Tail...> _Tuple;
+ typedef _RW::__rw_tuple<_Head, _Tail...> _Tuple;
-# define _RWSTD_ADD_CONST(T) \
- _TYPENAME _RW::__rw_add_const<T>::type
-# define _RWSTD_ADD_LVAL_REF(T) \
- _TYPENAME _RW::__rw_add_lvalue_reference<T>::type
-
- typedef _RWSTD_ADD_CONST (_Head) _Const;
- typedef _RWSTD_ADD_LVAL_REF (_Head) _Ref;
- typedef _RWSTD_ADD_LVAL_REF (_Const) _ConstRef;
-
-# undef _RWSTD_ADD_CONST
-# undef _RWSTD_ADD_LVAL_REF
+ typedef typename _RWSTD_ADD_LVALUE_REFERENCE (_Head) _Ref;
+ typedef typename _RWSTD_ADD_CONST (_Head) _ConstHead;
+ typedef typename _RWSTD_ADD_LVALUE_REFERENCE (_ConstHead) _ConstRef;
static _Ref
- __get (_Tuple& __tuple) { return __tuple.__get (); }
+ _C_get (_Tuple& __tuple) { return __tuple._C_head (); }
static _ConstRef
- __get (const _Tuple& __tuple) { return __tuple.__get (); }
+ _C_get (const _Tuple& __tuple) { return __tuple._C_head (); }
};
-template <int _Index, class _Head, class... _Tail>
+template <_RWSTD_SIZE_T _Index, class _Head, class... _Tail>
struct tuple_element<_Index, tuple<_Head, _Tail...> >
- : tuple_element<_Index - 1, tuple<_Tail...> >
+ : public tuple_element<_Index - 1, tuple<_Tail...> >
{
// empty
};
@@ -216,99 +378,95 @@
// 20.3.1.5, element access:
-/**
- * @function get
- *
- * Access Nth element value of a tuple. This function returns a
- * cv-qualified value reference to the Nth element in a tuple \c T
- * where 0 <= N < <code>tuple_size<T>::value</code>. If N is
- * not in this range, the program is ill-formed.
- *
- * @tparam Index An integer constant indicating the Nth element type.
- * @tparam Types List of element types in the tuple.
- * @param tuple A tuple value.
- * @return CV-qualified reference to the Nth element value of tuple.
- */
-
-template <int _Index, class _Head, class... _Tail>
-_TYPENAME tuple_element<_Index, tuple<_Head, _Tail...> >::_Ref
+template <_RWSTD_SIZE_T _Index, class _Head, class... _Tail>
+inline typename tuple_element<_Index, tuple<_Head, _Tail...> >::_Ref
get (tuple<_Head, _Tail...>& __tuple)
{
typedef tuple_element<_Index, tuple<_Head, _Tail...> > _Tuple;
- return _Tuple::__get (__tuple);
+ return _Tuple::_C_get (__tuple);
}
-template <int _Index, class _Head, class... _Tail>
-_TYPENAME tuple_element<_Index, tuple<_Head, _Tail...> >::_ConstRef
+template <_RWSTD_SIZE_T _Index, class _Head, class... _Tail>
+inline typename tuple_element<_Index, tuple<_Head, _Tail...> >::_ConstRef
get (const tuple<_Head, _Tail...>& __tuple)
{
typedef tuple_element<_Index, tuple<_Head, _Tail...> > _Tuple;
- return _Tuple::__get (__tuple);
+ return _Tuple::_C_get (__tuple);
}
// 20.3.1.6, relational operators:
template <class... _TypesT, class... _TypesU>
-bool operator== (const tuple<_TypesT...>& __x,
- const tuple<_TypesU...>& __y);
+inline bool
+operator== (const tuple<_TypesT...>& __x,
+ const tuple<_TypesU...>& __y)
+{
+ return _RWSTD_STATIC_CAST (const _RW::__rw_tuple<_TypesT...>&, __x)
+ == _RWSTD_STATIC_CAST (const _RW::__rw_tuple<_TypesU...>&, __y);
+}
+
+_RWSTD_SPECIALIZED_FUNCTION
+inline bool
+operator== (const tuple<>& /*__x*/,
+ const tuple<>& /*__y*/)
+{
+ return true;
+}
template <class... _TypesT, class... _TypesU>
-bool operator< (const tuple<_TypesT...>& __x,
- const tuple<_TypesU...>& __y);
+inline bool
+operator< (const tuple<_TypesT...>& __x,
+ const tuple<_TypesU...>& __y)
+{
+ return _RWSTD_STATIC_CAST (const _RW::__rw_tuple<_TypesT...>&, __x)
+ < _RWSTD_STATIC_CAST (const _RW::__rw_tuple<_TypesU...>&, __y);
+}
+
+_RWSTD_SPECIALIZED_FUNCTION
+inline bool
+operator< (const tuple<>& /*__x*/,
+ const tuple<>& /*__y*/)
+{
+ return false;
+}
-/**
- * @param __x Tuple value on LHS of operator.
- * @param __y Tuple value on RHS of operator.
- * @return !(__x == __y)
- */
template <class... _TypesT, class... _TypesU>
-bool operator!= (const tuple<_TypesT...>& __x,
- const tuple<_TypesU...>& __y)
+inline bool
+operator!= (const tuple<_TypesT...>& __x,
+ const tuple<_TypesU...>& __y)
{
return !(__x == __y);
}
-/**
- * @param __x Tuple value on LHS of operator.
- * @param __y Tuple value on RHS of operator.
- * @return __y < __x
- */
template <class... _TypesT, class... _TypesU>
-bool operator> (const tuple<_TypesT...>& __x,
- const tuple<_TypesU...>& __y)
+inline bool
+operator> (const tuple<_TypesT...>& __x,
+ const tuple<_TypesU...>& __y)
{
return __y < __x;
}
-
-/**
- * @param __x Tuple value on LHS of operator.
- * @param __y Tuple value on RHS of operator.
- * @return !(__y < __x)
- */
template <class... _TypesT, class... _TypesU>
-bool operator<= (const tuple<_TypesT...>& __x,
- const tuple<_TypesU...>& __y)
+inline bool
+operator<= (const tuple<_TypesT...>& __x,
+ const tuple<_TypesU...>& __y)
{
return !(__y < __x);
}
-/**
- * @param __x Tuple value on LHS of operator.
- * @param __y Tuple value on RHS of operator.
- * @return !(__x < __y)
- */
template <class... _TypesT, class... _TypesU>
-bool operator>= (const tuple<_TypesT...>& __x,
- const tuple<_TypesU...>& __y)
+inline bool
+operator>= (const tuple<_TypesT...>& __x,
+ const tuple<_TypesU...>& __y)
{
return !(__x < __y);
}
-# endif // !defined _RWSTD_NO_VARIADIC_TEMPLATES
-
} // namespace std
+
+# endif // !defined _RWSTD_NO_VARIADIC_TEMPLATES
+
#endif // _RWSTD_TUPLE_INCLUDED
Modified: stdcxx/trunk/include/type_traits
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/type_traits?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/include/type_traits (original)
+++ stdcxx/trunk/include/type_traits Fri Aug 1 13:51:17 2008
@@ -50,171 +50,11 @@
_RWSTD_NAMESPACE (std) {
-/**
- * @defgroup meta_help Helper classes [meta.help]
- */
-
-/**
- * @defgroup meta_unary Unary Type Traits [meta.unary]
- *
- * A UnaryTypeTrait describes a property of a type. It shall be a
- * class template that takes one template type argument and, optionally,
- * additional arguments that help define the property being described.
- * It shall be DefaultConstructible, CopyConstructible, and publicly
- * derived, directly or indirectly, from a specialization of the template
- * integral_constant, with the arguments to the template integral_constant
- * determined by the requirements for the particular property being
- * described.
- *
- * This sub-clause contains templates that may be used to query the
- * properties of a type at compile time.
- *
- * Each of these templates shall be a UnaryTypeTrait, publicly derived
- * directly or indirectly from true_type if the corresponding condition
- * is true, otherwise from false_type.
- */
-
-/**
- * @defgroup meta_unary_cat Primary Type Categories [meta.unary.cat]
- * @ingroup meta_unary
- *
- * These type categories correspond to the descriptions given in section
- * [basic.types] of the C++ standard.
- *
- * For any given type T, the result of applying one of these templates
- * to T and to cv-qualified T shall yield the same result.
- *
- * @note For any given type T, exactly one of the primary type
- * categories has a \c value member that evaluates to true.
- */
-
-/**
- * @defgroup meta_unary_comp Composite Type Categories [meta.unary.comp]
- * @ingroup meta_unary
- *
- * These templates provide convenient compositions of the primary type
- * categories.
- *
- * For any given type T, the result of applying one of these templates
- * to T, and to cv-qualified T shall yield the same result.
- */
-
-/**
- * @defgroup meta_unary_prop Type Properties [meta.unary.prop]
- * @ingroup meta_unary
- *
- * These templates provide access to some of the more important properties
- * of types.
- *
- * It is unspecified whether the library defines any full or partial
- * specialisations of any of these templates. A program may specialise
- * any of these templates on a user-defined type, provided the semantics
- * of the specialisation match those given for the template in its
- * description.
- *
- * For all of the class templates X declared in this clause, instantiating
- * that template with a template-argument that is a class template
- * specialization may result in the implicit instantiation of the template
- * argument if and only if the semantics of X require that the argument
- * must be a complete type.
- */
-
-/**
- * @defgroup meta_rel Relationships between types [meta.rel]
- *
- * This sub-clause contains templates that may be used to query
- * relationships between types at compile time.
- *
- * Each of these templates shall be a BinaryTypeTrait, publicly
- * derived directly or indirectly from true_type if the
- * corresponding condition is true, otherwise from false_type.
- */
-
-/**
- * @defgroup meta_trans Transformations between types [meta.trans]
- *
- * A TransformationTrait modifies a property of a type. It shall
- * be a class template that takes one template type argument and,
- * optionally, additional arguments that help define the modification.
- * It shall define a nested type named type, which shall be a synonym
- * for the modified type.
- *
- * This sub-clause contains templates that may be used to transform
- * one type to another following some predefined rule.
- *
- * Each of the templates in this subclause shall be a
- * TransformationTrait.
- */
-
-/**
- * @defgroup meta_trans_cv Const-volatile modifications [meta.trans.cv]
- * @ingroup meta_trans
- *
- * This sub-clause contains templates used to add and remove const
- * and volatile qualifiers from types.
- */
-
-/**
- * @defgroup meta_trans_ref Reference modification [meta.trans.ref]
- * @ingroup meta_trans
- *
- * This sub-clause contains templates used to add and remove reference
- * semantics from types.
- */
-
-/**
- * @defgroup meta_trans_sign Sign modifications [meta.trans.sign]
- * @ingroup meta_trans
- *
- * This sub-clause contains templates used to transform from signed
- * to unsigned representation or vice-versa.
- */
-
-/**
- * @defgroup meta_trans_arr Array modifications [meta.trans.arr]
- * @ingroup meta_trans
- *
- * This sub-clause contains templates used to manage array types.
- */
-
-/**
- * @defgroup meta_trans_pointer Pointer modifications [meta.trans.ptr]
- * @ingroup meta_trans
- *
- * This sub-clause contains templates used to manage pointer types.
- */
-
-/**
- * @defgroup meta_trans_other Other transformations [meta.trans.other]
- * @ingroup meta_trans
- */
-
-/**
- * @ingroup meta_help
- *
- * The class template integral_constant and its associated typedefs
- * true_type and false_type are used as base classes to define the
- * interface for various type traits.
- *
- * @tparam _TypeT The type of the integral constant value.
- * @tparam _Value The value of the integral constant.
- */
template <class _TypeT, _TypeT _Value>
struct integral_constant
{
- /**
- * Describes the type of this integral_constant.
- */
typedef integral_constant<_TypeT,_Value> type;
-
- /**
- * Describes the type of the value defined by this integral_constant.
- */
typedef _TypeT value_type;
-
- /**
- * The actual integral constant value.
- */
static const _TypeT value = _Value;
};
@@ -225,1027 +65,388 @@
#endif // _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION
-/**
- * @ingroup meta_help
- *
- * Convenience typedef that are intended to be used as a base class
- * for boolean type traits that are true.
- */
typedef integral_constant<bool, true> true_type;
-
-/**
- * @ingroup meta_help
- *
- * Convenience typedef that are intended to be used as a base class
- * for boolean type traits that are false.
- */
typedef integral_constant<bool, false> false_type;
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is void or a cv-qualified
- * void.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_void
: integral_constant<bool, _RW::__rw_is_void<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is an integral type.
- * Types \c bool, \c char, \c wchar_t, and the signed and unsigned
- * integer types are collectively called integral types. The signed
- * and unsigned integer types include signed and unsigned versions
- * of \c char, \c short, \c int, \c long and \c long \c long.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_integral
: integral_constant<bool, _RW::__rw_is_integral<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * * \e UnaryTypeTrait to determine if _TypeT is a floating point type.
- *
- * Types \c float, \c double, \c long \c double, and cv-qualified versions
- * of those types make up the set of floating point types.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_floating_point
: integral_constant<bool, _RW::__rw_is_floating_point<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is an array type. Array types
- * include both arrays of bounded and unbounded length.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_array
: integral_constant<bool, _RW::__rw_is_array<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a pointer type.
- * Includes function pointers, but not pointers to non-static member
- * functions.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_pointer
: integral_constant<bool, _RW::__rw_is_pointer<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is an lvalue reference type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_lvalue_reference
: integral_constant<bool, _RW::__rw_is_lvalue_reference<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is an rvalue reference type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_rvalue_reference
: integral_constant<bool, _RW::__rw_is_rvalue_reference<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a reference type.
- *
- * @note References to functions are still references, not functions.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_reference
: integral_constant<bool, _RW::__rw_is_reference<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a pointer to non-static
- * member.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_member_object_pointer
: integral_constant<bool, _RW::__rw_is_member_object_pointer<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a pointer to non-static
- * member function.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_member_function_pointer
: integral_constant<bool, _RW::__rw_is_member_function_pointer<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is an enumeration type.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_enum
: integral_constant<bool, _RW::__rw_is_enum<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a union type
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- */
template <class _TypeT>
struct is_union
: integral_constant<bool, _RW::__rw_is_union<_TypeT>::value >
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a class type but not
- * a union type.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- * @note a C++ struct is of class type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_class
: integral_constant<bool, _RW::__rw_is_class<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_cat
- *
- * \e UnaryTypeTrait to determine if _TypeT is a function type.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_function
: integral_constant<bool, _RW::__rw_is_function<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_comp
- *
- * \e UnaryTypeTrait to determine if _TypeT is an arithmetic type.
- * Arithmetic types include both integral and floating point types.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_arithmetic
: integral_constant<bool, _RW::__rw_is_arithmetic<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_comp
- *
- * \e UnaryTypeTrait to determine if _TypeT is a fundamental type.
- * Fundamental types are all the types provided natively. These types
- * include all arithmetic types and all void types.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_fundamental
: integral_constant<bool, _RW::__rw_is_fundamental<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_comp
- *
- * \e UnaryTypeTrait to determine if _TypeT is an object type.
- * An object type is a (possibly cv-qualified) type that is not
- * a function type, not a reference type, and not a void type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_object
: integral_constant<bool, _RW::__rw_is_object<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_comp
- *
- * \e UnaryTypeTrait to determine if _TypeT is a scalar type.
- * Arithmetic types, enumeration types, pointer types, pointer
- * to member types, and cv-qualified versions of these types are
- * collectively called scalar types.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_scalar
: integral_constant<bool, _RW::__rw_is_scalar<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_comp
- *
- * \e UnaryTypeTrait to determine if _TypeT is a compound type.
- * Compound types are arrays, functions, pointers, references,
- * classes, unions, enumerations and pointers to non-static class
- * members.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_compound
: integral_constant<bool, _RW::__rw_is_compound<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_comp
- *
- * \e UnaryTypeTrait to determine if _TypeT is a pointer to a member
- * object or pointer to member function type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_member_pointer
: integral_constant<bool, _RW::__rw_is_member_pointer<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is const-qualified.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_const
: integral_constant<bool, _RW::__rw_is_const<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is volatile-qualified.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_volatile
: integral_constant<bool, _RW::__rw_is_volatile<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a trivial type. Scalar
- * types, trivial class types, arrays of such types and cv-qualified
- * versions of these types are collectively called trival types. Trivial
- * class types have a trivial default constructor, a trivial destructor
- * a trivial copy constructor and a trivial copy assignment operator.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct is_trivial
: integral_constant<bool, _RW::__rw_is_trivial<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a type with standard
- * layout. Scalar types, standard-layout class types, arrays of such
- * types and cv-qualified versions of these types are collectively
- * called standard layout types. Standard layout class types have no
- * non-static data members of non-standard-layout class or reference.
- * They have no virtual functions and no virtual base classes, use the
- * same access control for all non-static data members, have no base
- * classes of non-standard-layout type, no non-static data members in
- * the most-derived class and at most one base class with non-static
- * data members or has no base classes with non-static data members.
- * Finally, a standard-layout class has no base classes of the same
- * type as the first non-static data member.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct is_standard_layout
: integral_constant<bool, _RW::__rw_is_standard_layout<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a plain-old-data type.
- * Scalar types, pod classes, arrays of such types and cv-qualified
- * versions of these types are collectively called pod types. The pod
- * class types meet the requirements of both trivial and standard layout
- * types and have no non-static data members of non-pod type.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct is_pod
: integral_constant<bool, _RW::__rw_is_pod<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is an empty class.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct is_empty
: integral_constant<bool, _RW::__rw_is_empty<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a polymorphic class.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct is_polymorphic
: integral_constant<bool, _RW::__rw_is_polymorphic<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is an abstract class.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct is_abstract
: integral_constant<bool, _RW::__rw_is_abstract<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a trivial type or a
- * class type with a trivial default constructor, or an array of
- * such a class type.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_trivial_default_constructor
: integral_constant<bool, _RW::__rw_has_trivial_ctor<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a trivial type, a
- * reference type, or a class type with a trivial copy constructor.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_trivial_copy_constructor
: integral_constant<bool, _RW::__rw_has_trivial_copy<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is neither const nor a
- * reference type and is a trivial type or a class type with a trivial
- * assignment operator.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_trivial_assign
: integral_constant<bool, _RW::__rw_has_trivial_assign<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a trivial type, a reference
- * type, or a class type with a trivial destructor, or an array of such a
- * class type.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_trivial_destructor
: integral_constant<bool, _RW::__rw_has_trivial_dtor<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if the default constructor for _TypeT
- * has an empty exception specification or can otherwise be deduced to
- * never throw an exception.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_nothrow_default_constructor
: integral_constant<bool, _RW::__rw_has_nothrow_ctor<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if the copy constructor for _TypeT has
- * an empty exception specification or can otherwise be deduced to never
- * throw an exception.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_nothrow_copy_constructor
: integral_constant<bool, _RW::__rw_has_nothrow_copy<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if the assignment operator has an empty
- * exception specification or can otherwise be deduced never to throw an
- * exception.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_nothrow_assign
: integral_constant<bool, _RW::__rw_has_nothrow_assign<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT has a virtual destructor.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to evaluate. Shall be a complete type,
- * an array of unknown bound, or possibly cv-qualified void.
- */
template <class _TypeT>
struct has_virtual_destructor
: integral_constant<bool, _RW::__rw_has_virtual_dtor<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is a signed arithmetic
- * type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_signed
: integral_constant<bool, _RW::__rw_is_signed<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if _TypeT is an unsigned arithmetic
- * type.
- *
- * @tparam _TypeT The type to evaluate.
- */
template <class _TypeT>
struct is_unsigned
: integral_constant<bool, _RW::__rw_is_unsigned<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine the alignment of objects of type
- * _TypeT.
- *
- * @note This may not be accurate if the necessary compiler support
- * is not available.
- *
- * @tparam _TypeT The type to evaluate.
- */
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
template <class _TypeT>
struct alignment_of
: integral_constant<_RWSTD_SIZE_T, _RW::__rw_alignment_of<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine the rank of objects of type _TypeT.
- * If _TypeT names an array type, the rank is an integer value that
- * represents the number of dimensions of _TypeT, otherwise the value
- * is 0.
- *
- * @tparam _TypeT The type to evaluate.
- */
+#endif // _RWSTD_NO_ALIGN_TRAITS
+
template <class _TypeT>
struct rank
: integral_constant<_RWSTD_SIZE_T, _RW::__rw_rank<_TypeT>::value>
{
};
-/**
- * @ingroup meta_unary_prop
- *
- * \e UnaryTypeTrait to determine if the extent of one dimension of
- * objects of type _TypeT. If _TypeT is an array type with rank greater
- * than _Bound, the value will be the size of the given dimension of
- * that array, otherwise the value is 0.
- *
- * @tparam _TypeT The type to evaluate.
- * @tparam _Bound The dimension of the array to get the extent of.
- */
template <class _TypeT, unsigned _Bound = 0>
struct extent
: integral_constant<_RWSTD_SIZE_T, _RW::__rw_extent<_TypeT, _Bound>::value>
{
};
-/**
- * @ingroup meta_rel
- *
- * \e UnaryTypeTrait to determine if _TypeT and _TypeU are exactly the
- * same type.
- *
- * @tparam _TypeT The first type to compare.
- * @tparam _TypeT The second type to compare.
- */
template <class _TypeT, class _TypeU>
struct is_same
: integral_constant<bool, _RW::__rw_is_same<_TypeT, _TypeU>::value>
{
};
-/**
- * @ingroup meta_rel
- *
- * \e BinaryyTypeTrait to determine if _TypeT is a base class of _TypeU
- * or _TypeT and _TypeU name the same non-union class type without regard
- * to cv-qualifiers.
- *
- * @note Base classes that are private, protected or ambiguous are,
- * nonetheless, base classes.
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The base type.
- * @tparam _TypeU The derived type.
- */
template <class _TypeT, class _TypeU>
struct is_base_of
: integral_constant<bool, _RW::__rw_is_base_of<_TypeT, _TypeU>::value>
{
};
-/**
- * @ingroup meta_rel
- *
- * \e BinaryTypeTrait to determine if lvalue of type _TypeT is implicitly
- * convertible to _TypeU ([conv]).
- *
- * @note This may not be accurate for class types if the necessary
- * compiler support is not available.
- *
- * @tparam _TypeT The type to test conversion from.
- * @tparam _TypeT The type to test conversion to.
- */
template <class _TypeT, class _TypeU>
struct is_convertible
: integral_constant<bool, _RW::__rw_is_convertible<_TypeT, _TypeU>::value>
{
};
-/**
- * @ingroup meta_trans_cv
- *
- * \e TransformationTrait to remove any top-level const-qualifier.
- * The member typedef \c type shall be the same as _TypeT except that
- * any top level const-qualifier has been removed.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_const
{
- typedef _TYPENAME _RW::__rw_remove_const<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_const<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_cv
- *
- * \e TransformationTrait to remove any top-level volatile-qualifier.
- * The member typedef \c type shall be the same as _TypeT except that
- * any top level volatile-qualifier has been removed.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_volatile
{
- typedef _TYPENAME _RW::__rw_remove_volatile<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_volatile<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_cv
- *
- * \e TransformationTrait to remove any top-level cv-qualifiers. The
- * member typedef \c type shall be the same as _TypeT except that any
- * top level cv-qualifier has been removed.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_cv
{
- typedef _TYPENAME _RW::__rw_remove_cv<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_cv<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_cv
- *
- * \e TransformationTrait to add a top-level const-qualifier. If
- * _TypeT is a reference, function, or other type level const-
- * qualified type then \c type shall be the same as _TypeT,
- * otherwise _TypeT const.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct add_const
{
- typedef _TYPENAME _RW::__rw_add_const<_TypeT>::type type;
+ typedef typename _RW::__rw_add_const<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_cv
- *
- * \e TransformationTrait to add a top-level volatile-qualifier.
- * If _TypeT is a reference, function, or other type level volatile-
- * qualified type then \c type shall be the same as _TypeT,
- * otherwise _TypeT volatile.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct add_volatile
{
- typedef _TYPENAME _RW::__rw_add_volatile<_TypeT>::type type;
+ typedef typename _RW::__rw_add_volatile<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_cv
- *
- * \e TransformationTrait to add a top-level const and volatile-qualifier.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct add_cv
{
- typedef _TYPENAME _RW::__rw_add_cv<_TypeT>::type type;
+ typedef typename _RW::__rw_add_cv<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_ref
- *
- * \e TransformationTrait to remove a reference from _TypeT.
- *
- * The member typedef \c type shall be the same as _TypeT, except
- * any reference qualifier has been removed.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_reference
{
- typedef _TYPENAME _RW::__rw_remove_reference<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_reference<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_ref
- *
- * \e TransformationTrait to add a reference to _TypeT.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct add_lvalue_reference
{
- typedef _TYPENAME _RW::__rw_add_lvalue_reference<_TypeT>::type type;
+ typedef typename _RW::__rw_add_lvalue_reference<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_ref
- *
- * \e TransformationTrait to add an rvalue-reference to _TypeT.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct add_rvalue_reference
{
- typedef _TYPENAME _RW::__rw_add_rvalue_reference<_TypeT>::type type;
+ typedef typename _RW::__rw_add_rvalue_reference<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_sign
- *
- * \e TransformationTrait to get a signed type from an enum or non-
- * boolean integral type.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct make_signed
{
- typedef _TYPENAME _RW::__rw_make_signed<_TypeT>::type type;
+ typedef typename _RW::__rw_make_signed<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_sign
- *
- * \e TransformationTrait to get an unsigned type from an enum or non-
- * boolean integral type.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct make_unsigned
{
- typedef _TYPENAME _RW::__rw_make_unsigned<_TypeT>::type type;
+ typedef typename _RW::__rw_make_unsigned<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_arr
- *
- * \e TransformationTrait to remove a dimension from the type _TypeT.
- * If _TypeT is 'array of _TypeU', the member typedef \c type shall
- * be _TypeU, otherwise _TypeT.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_extent
{
- typedef _TYPENAME _RW::__rw_remove_extent<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_extent<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_arr
- *
- * \e TransformationTrait to remove all dimensions from the type
- * _TypeT. If _TypeT is 'multi-dimensional array of _TypeU', the
- * member typedef \c type shall be _TypeU otherwise _TypeT.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_all_extents
{
- typedef _TYPENAME _RW::__rw_remove_all_extents<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_all_extents<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_pointer
- *
- * \e TransformationTrait to remove a pointer from the type _TypeT.
- * The member typedef \c type shall be the same as _TypeT, except
- * any top level indirection has been removed.
- *
- * @note pointers to members are left unchanged.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct remove_pointer
{
- typedef _TYPENAME _RW::__rw_remove_pointer<_TypeT>::type type;
+ typedef typename _RW::__rw_remove_pointer<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_pointer
- *
- * \e TransformationTrait to add a pointer to the type _TypeT.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct add_pointer
{
- typedef _TYPENAME _RW::__rw_add_pointer<_TypeT>::type type;
+ typedef typename _RW::__rw_add_pointer<_TypeT>::type type;
};
-/**
- * @ingroup meta_trans_other
- *
- * Special trait the defines a nested pod type that is suitable for
- * use as uninitialized storage for any object whose size is at most
- * _Len and alignment is a divisor of align.
- *
- * @tparam _Len The minimum size of the aligned storage. Shall not be 0.
- * @tparam _Align The alignment of the aligned storage. Shall be equal
- * to alignment_of<T> for some type T or not provided. The implementation
- * requires that the alignment value be a non-zero power of two that is
- * less than the maximum supported extended alignment.
- */
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
template <_RWSTD_SIZE_T _Len,
_RWSTD_SIZE_T _Align = _RW::__rw_default_alignment<_Len>::value>
struct aligned_storage
{
- typedef _TYPENAME _RW::__rw_aligned_storage<_Len, _Align>::type type;
+ typedef typename _RW::__rw_aligned_storage<_Len, _Align>::type type;
};
-#ifndef _RWSTD_NO_VARIADIC_TEMPLATES
+# ifndef _RWSTD_NO_VARIADIC_TEMPLATES
-/**
- * @ingroup meta_trans_other
- *
- * Special trait the defines a nested pod type that is suitable for
- * use as uninitialized storage for any object whose type is listed
- * in _Types and whose size is at most _Len.
- *
- * @tparam _Len The minimum size of the aligned storage.
- * @tparam _Types List of types which might be stored.
- */
template <_RWSTD_SIZE_T _Len, class _TypeT, class... _Types>
struct aligned_union
: _RW::__rw_aligned_union<_Len, _TypeT, _Types...>
{
+ static const _RWSTD_SIZE_T alignment_value =
+ _RW::__rw_aligned_union<_Len, _TypeT, _Types...>::_C_align_value;
};
-#else
+# else // !_RWSTD_NO_VARIADIC_TEMPLATES
-/**
- * @ingroup meta_trans_other
- *
- * Special trait the defines a nested pod type that is suitable for
- * use as uninitialized storage for any object whose type is listed
- * in _Types and whose size is at most _Len.
- *
- * @tparam _Len The minimum size of the aligned storage.
- * @tparam _Type1 Type which might be stored.
- * @tparam _Type2 Type which might be stored.
- * @tparam _Type3 Type which might be stored.
- * @tparam _Type4 Type which might be stored.
- * @tparam _Type5 Type which might be stored.
- * @tparam _Type6 Type which might be stored.
- * @tparam _Type7 Type which might be stored.
- * @tparam _Type8 Type which might be stored.
- */
template <_RWSTD_SIZE_T _Len,
class _Type1 , class _Type2 = _RW::__rw_empty,
class _Type3 = _RW::__rw_empty, class _Type4 = _RW::__rw_empty,
@@ -1256,39 +457,22 @@
_Type1, _Type2, _Type3, _Type4,
_Type5, _Type6, _Type7, _Type8>
{
+ static const _RWSTD_SIZE_T alignment_value =
+ _RW::__rw_aligned_union<_Len, _Type1, _Type2,
+ _Type3, _Type4,
+ _Type5, _Type6,
+ _Type7, _Type8>::_C_align_value;
};
-#endif
+# endif // !_RWSTD_NO_VARIADIC_TEMPLATES
+#endif // !_RWSTD_NO_ALIGN_TRAITS
-/**
- * @ingroup meta_trans_other
- *
- * \e TransformationTrait to do array-to-pointer and function-to-pointer
- * type conversions.
- *
- * Let \c U be \c remove_reference<T>::type. If \c is_array<U>::value is
- * true, the member typedef type shall equal remove_extent<U>::type*. If
- * \c is_function<U>::value is true, the member typedef shall equal
- * \c add_pointer<U>::type. Otherwise the member typedef type equals \c U.
- *
- * @tparam _TypeT The type to transform.
- */
template <class _TypeT>
struct decay
{
- typedef _TYPENAME _RW::__rw_decay<_TypeT>::type type;
+ typedef typename _RW::__rw_decay<_TypeT>::type type;
};
-
-/**
- * @ingroup meta_trans_other
- *
- * If _Enable is true, the member typedef \c type shall equal _TypeT;
- * otherwise, there shall be no member typedef \c type.
- *
- * @tparam _Enable Flag used to select the primary template or the
- * specialization.
- * @tparam _TypeT The type of the member typedef if _Enable is true.
- */
+
template <bool _Enable, class _TypeT = void>
struct enable_if
{
@@ -1299,22 +483,11 @@
struct enable_if<false, _TypeT>
{
};
-
-/**
- * @ingroup meta_trans_other
- *
- * If _Select is true, the member typedef \c type shall equal _TypeT
- * otherwise \c type shall equal _TypeU.
- *
- * @tparam _Select Flag used to select the primary template or the
- * specialization.
- * @tparam _TypeT The type of the member typedef if _Select is true.
- * @tparam _TypeU The type of the member typedef if _Select is false.
- */
+
template <bool _Select, class _TypeT, class _TypeU>
struct conditional
{
- typedef _TYPENAME
+ typedef typename
_RW::__rw_conditional<_Select, _TypeT, _TypeU>::type type;
};
Modified: stdcxx/trunk/include/utility
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/utility?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/include/utility (original)
+++ stdcxx/trunk/include/utility Fri Aug 1 13:51:17 2008
@@ -46,6 +46,11 @@
#include <rw/_pair.h>
#include <rw/_relops.h>
+
+#ifndef _RWSTD_NO_EXT_CXX_0X
+# include <rw/_ref_wrap.h>
+#endif
+
#include <rw/_defs.h>
Modified: stdcxx/trunk/include/valarray
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/valarray?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/include/valarray (original)
+++ stdcxx/trunk/include/valarray Fri Aug 1 13:51:17 2008
@@ -77,7 +77,7 @@
valarray () { }
// 26.3.2.1, p2
- _EXPLICIT valarray (_RWSTD_SIZE_T __size)
+ explicit valarray (_RWSTD_SIZE_T __size)
: _C_array (value_type (), __size) { }
// 26.3.2.1, p3
@@ -238,12 +238,12 @@
// implements symmetric non-member valarray binary operators
template<class _TypeT, class _BinaryFunction>
-inline _STD::valarray<_TYPENAME _BinaryFunction::result_type>
+inline _STD::valarray<typename _BinaryFunction::result_type>
__rw_binary_function (const _STD::valarray<_TypeT> &__lhs,
const _STD::valarray<_TypeT> &__rhs,
_BinaryFunction __fun)
{
- typedef _TYPENAME _BinaryFunction::result_type result_type;
+ typedef typename _BinaryFunction::result_type result_type;
typedef _STD::raw_storage_iterator<result_type*, result_type> _Iter;
// allocate but do not initialize
@@ -261,11 +261,11 @@
// implements asymmetric non-member valarray binary operators
template<class _TypeT, class _BinaryFunction>
-inline _STD::valarray<_TYPENAME _BinaryFunction::result_type>
+inline _STD::valarray<typename _BinaryFunction::result_type>
__rw_binary_function (const _STD::valarray<_TypeT> &__val,
_BinaryFunction __fun)
{
- typedef _TYPENAME _BinaryFunction::result_type result_type;
+ typedef typename _BinaryFunction::result_type result_type;
typedef _STD::raw_storage_iterator<result_type*, result_type> _Iter;
// allocate but do not initialize
Modified: stdcxx/trunk/include/vector
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/vector?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/include/vector (original)
+++ stdcxx/trunk/include/vector Fri Aug 1 13:51:17 2008
@@ -58,8 +58,6 @@
template <class _TypeT, class _Allocator = allocator<_TypeT> >
class vector;
-#ifdef _RWSTD_NO_MEMBER_TEMPLATES
-
// declarations of non-member function templates implementing
// the functionality of vector member function templates
@@ -83,8 +81,6 @@
void __rw_insert_range (vector<_TypeT, _Allocator>*, _VectorIter,
_FwdIter, _FwdIter, forward_iterator_tag);
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
_EXPORT
template <class _TypeT, class _Allocator>
@@ -94,12 +90,12 @@
typedef _TypeT value_type;
typedef _Allocator allocator_type;
- typedef _TYPENAME allocator_type::size_type size_type;
- typedef _TYPENAME allocator_type::difference_type difference_type;
- typedef _TYPENAME allocator_type::reference reference;
- typedef _TYPENAME allocator_type::const_reference const_reference;
- typedef _TYPENAME allocator_type::pointer pointer;
- typedef _TYPENAME allocator_type::const_pointer const_pointer;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename allocator_type::difference_type difference_type;
+ typedef typename allocator_type::reference reference;
+ typedef typename allocator_type::const_reference const_reference;
+ typedef typename allocator_type::pointer pointer;
+ typedef typename allocator_type::const_pointer const_pointer;
typedef _RWSTD_ALLOC_TYPE (allocator_type, value_type) _C_value_alloc_type;
public:
@@ -155,11 +151,11 @@
public:
- _EXPLICIT
+ explicit
vector (const allocator_type &__alloc = allocator_type ())
: allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { }
- _EXPLICIT
+ explicit
vector (size_type __n, const_reference __x = value_type (),
const allocator_type &__alloc = allocator_type ())
: allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () {
@@ -328,8 +324,6 @@
// implements insert with repetition
void _C_insert_n (const iterator&, size_type, const_reference);
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
// implements range insert for ForwardIterators
template <class _FwdIter>
void _C_insert_range (iterator, _FwdIter, _FwdIter,
@@ -340,12 +334,6 @@
void _C_insert_range (iterator, _InputIter, _InputIter,
input_iterator_tag);
-#else // if defined (_RWSTD_NO_MEMBER_TEMPLATES)
-
-public:
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
// implements range assign
template <class _InputIter>
void _C_assign (_InputIter __first, _InputIter __last, void*) {
@@ -414,7 +402,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::reference
+inline typename vector<_TypeT, _Allocator>::reference
vector<_TypeT, _Allocator>::
operator[] (size_type __n)
{
@@ -432,7 +420,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::const_reference
+inline typename vector<_TypeT, _Allocator>::const_reference
vector<_TypeT, _Allocator>::
operator[] (size_type __n) const
{
@@ -450,7 +438,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::reference
+inline typename vector<_TypeT, _Allocator>::reference
vector<_TypeT, _Allocator>::
at (size_type __n)
{
@@ -463,7 +451,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::const_reference
+inline typename vector<_TypeT, _Allocator>::const_reference
vector<_TypeT, _Allocator>::
at (size_type __n) const
{
@@ -517,7 +505,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::iterator
+inline typename vector<_TypeT, _Allocator>::iterator
vector<_TypeT, _Allocator>::
insert (iterator __it, const_reference __x)
{
@@ -535,7 +523,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::iterator
+inline typename vector<_TypeT, _Allocator>::iterator
vector<_TypeT, _Allocator>::
erase (iterator __it)
{
@@ -555,7 +543,7 @@
template <class _TypeT, class _Allocator>
-inline _TYPENAME vector<_TypeT, _Allocator>::iterator
+inline typename vector<_TypeT, _Allocator>::iterator
vector<_TypeT, _Allocator>::
erase (iterator __first, iterator __last)
{
@@ -690,11 +678,11 @@
vector<bool, _Allocator >: private _Allocator
{
-#if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) && !defined (_RWSTD_NO_TYPENAME)
- // clear _TYPENAME
-# undef _TYPENAME
-# define _TYPENAME
-#endif // _RWSTD_NO_CLASS_PARTIAL_SPEC && !_RWSTD_NO_TYPENAME
+#if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ // clear typename
+# undef typename
+# define typename
+#endif // _RWSTD_NO_CLASS_PARTIAL_SPEC
typedef _RWSTD_REBIND(_Allocator, unsigned int) _C_value_alloc_type;
typedef vector _C_self;
@@ -703,16 +691,16 @@
typedef _Allocator allocator_type;
typedef bool value_type;
- typedef _TYPENAME allocator_type::size_type size_type;
- typedef _TYPENAME allocator_type::difference_type difference_type;
- typedef _TYPENAME _C_value_alloc_type::pointer pointer;
- typedef _TYPENAME _C_value_alloc_type::const_pointer const_pointer;
-
-#if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) && !defined (_RWSTD_NO_TYPENAME)
- // restore _TYPENAME
-# undef _TYPENAME
-# define _TYPENAME typename
-#endif // _RWSTD_NO_CLASS_PARTIAL_SPEC && !_RWSTD_NO_TYPENAME
+ typedef typename allocator_type::size_type size_type;
+ typedef typename allocator_type::difference_type difference_type;
+ typedef typename _C_value_alloc_type::pointer pointer;
+ typedef typename _C_value_alloc_type::const_pointer const_pointer;
+
+#if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ // restore typename
+# undef typename
+# define typename typename
+#endif // _RWSTD_NO_CLASS_PARTIAL_SPEC
class iterator;
class const_iterator;
@@ -1117,7 +1105,7 @@
#if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x530
// working around a SunPro 5.3 bug (see PR #25962)
- _EXPLICIT
+ explicit
#endif // SunPro > 5.3
vector (size_type __n, bool __val = bool (),
const _Allocator& __alloc = allocator_type ())
@@ -1291,6 +1279,7 @@
else
_C_insert(end(), __x);
}
+
void pop_back () { --_C_end; }
iterator insert (iterator __it, const bool& __x = bool())
@@ -1304,16 +1293,12 @@
_C_insert(__it, __x);
return begin() + __n;
}
+
void insert (iterator __it, size_type __n, const bool& __x);
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
template<class _InputIter>
void insert (iterator __it, _InputIter __first,
_InputIter __last);
-#else
- void insert (iterator __it, const_iterator __first,
- const_iterator __last);
-#endif
iterator erase (iterator __it)
{
@@ -1322,11 +1307,13 @@
--_C_end;
return __it;
}
+
iterator erase(iterator __first, iterator __last)
{
_C_end = _C_copy(__last, end(), __first);
return __first;
}
+
void swap (_C_self& __x)
{
if((_C_value_alloc_type)*this == (_C_value_alloc_type)__x)
@@ -1342,8 +1329,11 @@
__x=_x;
}
}
+
static void swap(reference __x, reference __y);
+
void flip ();
+
void clear()
{
erase(begin(),end());
Modified: stdcxx/trunk/include/vector.cc
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/vector.cc?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/include/vector.cc (original)
+++ stdcxx/trunk/include/vector.cc Fri Aug 1 13:51:17 2008
@@ -318,8 +318,6 @@
}
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
template<class _TypeT, class _Allocator>
template<class _InputIter>
void vector<_TypeT, _Allocator>::
@@ -327,17 +325,6 @@
{
vector* const __self = this;
-#else // if defined (_RWSTD_NO_MEMBER_TEMPLATES)
-
-template<class _TypeT, class _Allocator, class _InputIter>
-void
-__rw_assign_range (vector<_TypeT, _Allocator> *__self,
- _InputIter __first, _InputIter __last, input_iterator_tag)
-{
- typedef _TYPENAME vector<_TypeT, _Allocator>::iterator iterator;
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
_RWSTD_ASSERT_RANGE (__first, __last);
#ifndef _RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE
@@ -384,8 +371,6 @@
}
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
template <class _TypeT, class _Allocator>
template <class _FwdIter>
void vector<_TypeT, _Allocator>::
@@ -393,23 +378,6 @@
{
vector* const __self = this;
-#else // if defined (_RWSTD_NO_MEMBER_TEMPLATES)
-
-template <class _TypeT, class _Allocator, class _FwdIter>
-void
-__rw_assign_range (vector<_TypeT, _Allocator> *__self,
- _FwdIter __first, _FwdIter __last, forward_iterator_tag)
-{
- typedef _TYPENAME vector<_TypeT, _Allocator>::value_type value_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::allocator_type
- allocator_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::_C_value_alloc_type
- _C_value_alloc_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::size_type size_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::iterator iterator;
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
_RWSTD_ASSERT_RANGE (__first, __last);
#ifndef _RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE
@@ -477,8 +445,6 @@
}
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
template <class _TypeT, class _Allocator>
template <class _InputIter>
void vector<_TypeT, _Allocator>::
@@ -487,21 +453,6 @@
{
vector* const __self = this;
-#else // if defined (_RWSTD_NO_MEMBER_TEMPLATES)
-
-template <class _TypeT, class _Allocator, class _VectorIter, class _InputIter>
-void
-__rw_insert_range (vector<_TypeT, _Allocator> *__self, _VectorIter __it,
- _InputIter __first, _InputIter __last, input_iterator_tag)
-{
- typedef _TYPENAME vector<_TypeT, _Allocator>::value_type value_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::allocator_type
- allocator_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::size_type size_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::pointer pointer;
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
_RWSTD_ASSERT_RANGE (__it, end ());
_RWSTD_ASSERT_RANGE (__first, __last);
@@ -578,8 +529,6 @@
}
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
template <class _TypeT, class _Allocator>
template <class _FwdIter>
void vector<_TypeT, _Allocator>::
@@ -588,25 +537,6 @@
{
vector* const __self = this;
-#else // if defined (_RWSTD_NO_MEMBER_TEMPLATES)
-
-template <class _TypeT, class _Allocator, class _VectorIter, class _FwdIter>
-void
-__rw_insert_range (vector<_TypeT, _Allocator> *__self, _VectorIter __it,
- _FwdIter __first, _FwdIter __last,
- forward_iterator_tag)
-{
- typedef _TYPENAME vector<_TypeT, _Allocator>::value_type value_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::allocator_type
- allocator_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::_C_value_alloc_type
- _C_value_alloc_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::size_type size_type;
- typedef _TYPENAME vector<_TypeT, _Allocator>::pointer pointer;
- typedef _TYPENAME vector<_TypeT, _Allocator>::iterator iterator;
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
_RWSTD_ASSERT_RANGE (__it, end ());
_RWSTD_ASSERT_RANGE (__first, __last);
@@ -732,7 +662,6 @@
#ifndef _RWSTD_NO_BOOL
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
// The body of this function is duplicated in src/vecbool.cpp and
// further down in this file as well.
#if !defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
@@ -768,7 +697,6 @@
_C_begin = iterator(__q, 0);
}
}
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
@@ -850,35 +778,6 @@
}
-#ifdef _RWSTD_NO_MEMBER_TEMPLATES
- template <class _Allocator>
- void vector<bool,_Allocator >::insert (iterator __it,
- const_iterator __first,
- const_iterator __last)
- {
- if (__first == __last) return;
- size_type __n = _DISTANCE(__first, __last, size_type);
- if (capacity() - size() >= __n)
- {
- _C_copy_backward(__it, end(), _C_end + __n);
- _C_copy(__first, __last, __it);
- _C_end += __n;
- }
- else
- {
- size_type __len = size() + (max)(size(), __n);
- unsigned int* __q = _C_bit_alloc(__len);
- iterator __i = _C_copy(begin(), __it, iterator(__q, 0));
- __i = _C_copy(__first, __last, __i);
- _C_end = _C_copy(__it, end(), __i);
- _C_value_alloc_type (*this).
- deallocate((pointer)_C_begin._C_p,_C_bufend - _C_begin._C_p);
- _C_bufend = __q + (__len + _RWSTD_WORD_BIT - 1)/_RWSTD_WORD_BIT;
- _C_begin = iterator(__q, 0);
- }
- }
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
template <class _Allocator>
void vector<bool,_Allocator >::resize (size_type __new_size, bool __c)
{
Modified: stdcxx/trunk/src/collate.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/collate.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/src/collate.cpp (original)
+++ stdcxx/trunk/src/collate.cpp Fri Aug 1 13:51:17 2008
@@ -254,7 +254,7 @@
// non-ignore value will collate first
if (*weightp == 0) {
- typedef _TYPENAME _STR_T::value_type CharT;
+ typedef typename _STR_T::value_type CharT;
const CharT ign =
_STD::numeric_limits<CharT>::max ();
@@ -276,7 +276,7 @@
weightp = weightp + 1 + pass * impl->longest_weight;
// non-ignore value will collate first
if (*weightp == 0) {
- typedef _TYPENAME _STR_T::value_type CharT;
+ typedef typename _STR_T::value_type CharT;
const CharT ign =
_STD::numeric_limits<CharT>::max ();
@@ -292,7 +292,7 @@
}
// append a 1 to designate the end of the pass
- typedef _TYPENAME _STR_T::value_type CharT;
+ typedef typename _STR_T::value_type CharT;
out += CharT (1);
cur_start = cur_end;
Modified: stdcxx/trunk/src/podarray.h
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/podarray.h?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/src/podarray.h (original)
+++ stdcxx/trunk/src/podarray.h Fri Aug 1 13:51:17 2008
@@ -89,7 +89,7 @@
*_C_pbuf = _TypeT ();
}
- _EXPLICIT __rw_pod_array (const _TypeT *__a)
+ explicit __rw_pod_array (const _TypeT *__a)
: _C_len (_C_length (__a))
// , _C_pbuf (_C_len < _Size ? _C_buffer : new _TypeT [_C_len + 1])
{
Modified: stdcxx/trunk/src/vecbool.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/vecbool.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/src/vecbool.cpp (original)
+++ stdcxx/trunk/src/vecbool.cpp Fri Aug 1 13:51:17 2008
@@ -124,36 +124,6 @@
}
-# ifdef _RWSTD_NO_MEMBER_TEMPLATES
-
-// The body of this function is duplicated in include/vector.cc
-void vector<bool, allocator<bool> >::
-insert (iterator pos, const_iterator __first, const_iterator __last)
-{
- if (__first == __last)
- return;
-
- size_type __n = _DISTANCE (__first, __last, size_type);
- if (capacity() - size() >= __n) {
- _C_copy_backward(pos, end(), _C_end + __n);
- _C_copy(__first, __last, pos);
- _C_end += __n;
- }
- else {
- size_type __len = size() + max(size(), __n);
- unsigned int* __q = _C_bit_alloc(__len);
- iterator __i = _C_copy(begin(), pos, iterator(__q, 0));
- __i = _C_copy(__first, __last, __i);
- _C_end = _C_copy(pos, end(), __i);
- _C_value_alloc_type (*this).
- deallocate(_C_begin._C_p,_C_bufend-_C_begin._C_p);
- _C_bufend = __q + (__len + _RWSTD_WORD_BIT - 1)/_RWSTD_WORD_BIT;
- _C_begin = iterator(__q, 0);
- }
-}
-
-# endif // _RWSTD_NO_MEMBER_TEMPLATES
-
void vector<bool, allocator<bool> >::
resize (size_type __new_size, bool __c)
{
Modified: stdcxx/trunk/tests/containers/23.bitset.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/containers/23.bitset.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/containers/23.bitset.cpp (original)
+++ stdcxx/trunk/tests/containers/23.bitset.cpp Fri Aug 1 13:51:17 2008
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 2001-2006 Rogue Wave Software.
+ * Copyright 2001-2008 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -65,13 +65,13 @@
bits_ [N] = '\0'; // null-terminate
}
- _EXPLICIT test_set (unsigned long val) {
+ explicit test_set (unsigned long val) {
for (std::size_t i = 0; i != N; ++i)
set (i, !!(val & (1UL << i)));
bits_ [N] = '\0'; // NUL-terminate
}
- _EXPLICIT test_set (const std::bitset<N> &rhs) {
+ explicit test_set (const std::bitset<N> &rhs) {
for (std::size_t i = 0; i != N; ++i)
set (i, rhs.test (i));
bits_ [N] = '\0'; // NUL-terminate
@@ -187,8 +187,6 @@
/**************************************************************************/
-#ifndef _RWSTD_NO_EXPLICIT
-
// helper to verify that bitset ctor is explicit
// not defined since it must not be referenced if test is successful
// static commented out to prevent gcc warning: function declared
@@ -206,8 +204,6 @@
static void
is_explicit (const has_implicit_ctor&) { }
-#endif // _RWSTD_NO_EXPLICIT
-
static void
test_synopsis (std::bitset<0>*)
@@ -239,15 +235,14 @@
MEMFUN (Reference&, flip, ());
// 23.3.5.1 - verify bitset ctors
-#if !defined (_RWSTD_NO_EXPLICIT) \
- && (!defined (__SUNPRO_CC) || __SUNPRO_CC > 0x530) \
+#if (!defined (__SUNPRO_CC) || __SUNPRO_CC > 0x530) \
&& (!defined (__GNUG__) || __GNUG__ >= 3)
// working around a SunPro 5.2 bug (see PR #25959)
// verify that bitset ctor is declared explicit
is_explicit (std::string ());
-#endif // _RWSTD_NO_EXPLICIT && SunPro > 5.3
+#endif // SunPro > 5.3
// verify default arguments
(void)Bitset (std::string ());
@@ -283,13 +278,12 @@
MEMFUN (unsigned long, to_ulong, () const);
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-# if !defined (__HP_aCC) || __HP_aCC >= 60000
+#if !defined (__HP_aCC) || __HP_aCC >= 60000
// working around HP aCC bugs PR #23312 and bug #503
-# define PARAMLIST_3(T) T, std::char_traits<T>, std::allocator<T>
-# define PARAMLIST_2(T) T, std::char_traits<T>
+# define PARAMLIST_3(T) T, std::char_traits<T>, std::allocator<T>
+# define PARAMLIST_2(T) T, std::char_traits<T>
// exercise the overloaded member template function and ordinary
// member function to_string()
@@ -298,21 +292,20 @@
MEMFUN (std::basic_string<PARAMLIST_3 (char) >,
to_string, (char, char) const);
-# ifndef _RWSTD_NO_WCHAR_T
+# ifndef _RWSTD_NO_WCHAR_T
MEMFUN (std::basic_string<PARAMLIST_3 (wchar_t) >,
to_string<PARAMLIST_3 (wchar_t) >, (wchar_t, wchar_t) const);
-# endif // _RWSTD_NO_WCHAR_T
+# endif // _RWSTD_NO_WCHAR_T
MEMFUN (std::basic_string<PARAMLIST_3 (int) >,
to_string<PARAMLIST_3 (int) >, (int, int) const);
-# undef PARAMLIST_3
-# undef PARAMLIST_2
+# undef PARAMLIST_3
+# undef PARAMLIST_2
-# endif // !__HP_aCC || __HP_aCC >= 60000
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
+#endif // !__HP_aCC || __HP_aCC >= 60000
MEMFUN (std::size_t, size, () const);
MEMFUN (std::size_t, count, () const);
@@ -353,17 +346,16 @@
FUN (std::basic_ostream< PARAMLIST (char) >&, std::operator<<,
(std::basic_ostream< PARAMLIST (char) >&, const Bitset&));
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-# ifndef _RWSTD_NO_WCHAR_T
+#ifndef _RWSTD_NO_WCHAR_T
FUN (std::basic_istream< PARAMLIST (wchar_t) >&, std::operator>>,
(std::basic_istream< PARAMLIST (wchar_t) >&, Bitset&));
FUN (std::basic_ostream< PARAMLIST (wchar_t) >&, std::operator<<,
(std::basic_ostream< PARAMLIST (wchar_t) >&, const Bitset&));
-# endif // _RWSTD_NO_WCHAR_T
+#endif // _RWSTD_NO_WCHAR_T
-# if !defined (_MSC_VER) || _MSC_VER > 1300
+#if !defined (_MSC_VER) || _MSC_VER > 1300
// MSVC is too dumb to handle bitset inserters and extractors
// parametrized on multiple template paramenters
@@ -372,8 +364,7 @@
FUN (std::basic_ostream< PARAMLIST (int) >&, std::operator<<,
(std::basic_ostream< PARAMLIST (int) >&, const Bitset&));
-# endif // !defined (_MSC_VER) || _MSC_VER > 1300
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
+#endif // !defined (_MSC_VER) || _MSC_VER > 1300
#undef PARAMLIST
@@ -724,7 +715,7 @@
N, _j, test_set<N>(b).bits ());
// exercise std::bitset<N>::reference
- _TYPENAME std::bitset<N>::reference r = b [_j];
+ typename std::bitset<N>::reference r = b [_j];
// std::bitset<N>::reference::flip()
r.flip ();
@@ -844,8 +835,6 @@
}
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
// call the bitset<N>::to_string() member function template,
// explicitly specifying all three template arguments,
// and 2, 1, or 0 of the two default function arguments
@@ -972,8 +961,6 @@
return bs.template to_string<UserChar>(zero, one);
}
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
// call the bitset<N>::to_string() ordinary member function,
// explicitly specifying none of the three template arguments,
@@ -1061,8 +1048,6 @@
int pos;
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
////////////////////////////////////////////////////////////////////////
// exercise the overload of the to_string() member function template
// that takes all three template parameters different from char,
@@ -1217,8 +1202,6 @@
to_string (ts.bits (), "ox").c_str (),
TO_STR (str1), pos);
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
////////////////////////////////////////////////////////////////////////
// exercise the non-template overload of the to_string() member
Modified: stdcxx/trunk/tests/containers/23.deque.modifiers.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/containers/23.deque.modifiers.cpp (original)
+++ stdcxx/trunk/tests/containers/23.deque.modifiers.cpp Fri Aug 1 13:51:17 2008
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2008 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -1248,8 +1248,7 @@
/**************************************************************************/
-#ifndef _RWSTD_NO_EXPLICIT
-# if !defined (_MSC_VER) || _MSC_VER > 1200
+#if !defined (_MSC_VER) || _MSC_VER > 1200
struct DR_438
{
@@ -1264,13 +1263,10 @@
bool DR_438::cast_used;
-# else // if MSVC <= 6.0
- // avoid an MSVC 6.0 ICE on this code
-# define NO_DR_438_TEST "this version of MSVC is too broken"
-# endif // !MSVC || MSVC > 6.0
-#else
-# define NO_DR_438_TEST "_RWSTD_NO_EXPLICIT #defined"
-#endif // _RWSTD_NO_EXPLICIT
+#else // if MSVC <= 6.0
+ // avoid an MSVC 6.0 ICE on this code
+# define NO_DR_438_TEST "this version of MSVC is too broken"
+#endif // !MSVC || MSVC > 6.0
void test_dr_438 ()
Modified: stdcxx/trunk/tests/diagnostics/19.std.exceptions.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/diagnostics/19.std.exceptions.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/diagnostics/19.std.exceptions.cpp (original)
+++ stdcxx/trunk/tests/diagnostics/19.std.exceptions.cpp Fri Aug 1 13:51:17 2008
@@ -157,8 +157,6 @@
_RWSTD_UNUSED (e);
-#ifndef _RWSTD_NO_EXPLICIT
-
// verify that each exceptions converting ctor is explicit
// use a pointer since std::string need not be a complete class
const char s[40] = "";
@@ -169,8 +167,6 @@
// (if one exists) is also explicit
is_explicit (s);
-#endif // _RWSTD_NO_EXPLICIT
-
return result;
}
Modified: stdcxx/trunk/tests/include/rw_testdefs.h
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/include/rw_testdefs.h?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/include/rw_testdefs.h (original)
+++ stdcxx/trunk/tests/include/rw_testdefs.h Fri Aug 1 13:51:17 2008
@@ -62,11 +62,6 @@
#endif // _RWSTD_NO_NAMESPACE && !std
-#if defined (_RWSTD_NO_TYPENAME) && !defined (typename)
-# define typename /* ignore */
-#endif // _RWSTD_NO_TYPENAME && !typename
-
-
#if defined (_RWSTD_NO_EXCEPTIONS)
# ifndef try
# define try if (0); else
@@ -173,4 +168,9 @@
# pragma warning (disable: 279)
#endif // Intel C++ 10.0 and prior
+#if ((4 < __GNUC__) || ((4 == __GNUC__) && (3 < __GNUC_MINOR__))) \
+ || (310 < __EDG_VERSION__)
+# define _RWSTD_TT_STRICT_CXX_0X_CONFORM
+#endif
+
#endif // RW_TESTDEFS_H_INCLUDED
Modified: stdcxx/trunk/tests/intro/17.names.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/intro/17.names.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/intro/17.names.cpp (original)
+++ stdcxx/trunk/tests/intro/17.names.cpp Fri Aug 1 13:51:17 2008
@@ -554,7 +554,12 @@
#define Tp !ERROR!
#define traits !ERROR!
#define Traits !ERROR!
-#define type !ERROR!
+
+#ifdef _RWSTD_NO_EXT_CXX_0X
+// required member of reference_wrapper
+# define type !ERROR!
+#endif
+
#define Type !ERROR!
#define UCHAR !ERROR!
#define UINT !ERROR!
Modified: stdcxx/trunk/tests/localization/22.locale.synopsis.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.synopsis.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/localization/22.locale.synopsis.cpp (original)
+++ stdcxx/trunk/tests/localization/22.locale.synopsis.cpp Fri Aug 1 13:51:17 2008
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2008 Rogue Wave Software.
+ * Copyright 1994-2008 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -391,8 +391,6 @@
/***************************************************************************/
-#ifndef _RWSTD_NO_EXPLICIT
-
// helper to verify that locale and facet ctors are explicit
// not defined since they must not be referenced if test is successful
void is_explicit (const std::locale&);
@@ -425,8 +423,6 @@
// calls to the overloaded is_explicit() resolve to the function below
void is_explicit (const has_implicit_ctor&) { /* empty */ }
-#endif // _RWSTD_NO_EXPLICIT
-
/***************************************************************************/
// local to test_locale
@@ -446,13 +442,9 @@
static std::locale::id id;
-#ifdef _RWSTD_NO_MEMBER_TEMPLATES
-
virtual std::locale::id& _C_get_id () const {
return id;
}
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
};
@@ -575,14 +567,12 @@
~Facet () {
is_dtor_virtual = true;
}
-#ifdef _RWSTD_NO_MEMBER_TEMPLATES
virtual std::locale::id& _C_get_id () const {
static std::locale::id id;
return id;
}
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
};
// delete a derived object using a pointer to the base
@@ -610,8 +600,6 @@
// 22.1.1.2, p9
(void)std::locale (l, "", std::locale::all);
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
Facet *pf = new Facet (1 /* ref count */);
{
@@ -650,8 +638,6 @@
pf = 0;
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
// 22.1.1.2, p14
(void)std::locale (l, l, std::locale::all);
@@ -674,18 +660,14 @@
#endif // __HP_aCC > 33000
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
-# if !defined __HP_aCC || __HP_aCC > 33100
+#if !defined __HP_aCC || __HP_aCC > 33100
// working around an HP aCC bug (see PR #23312)
// 22.1.1.3, p1
MEMFUN (std::locale, combine<Facet>, (const std::locale&) const);
-# endif // __HP_aCC > 33000
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
+#endif // __HP_aCC > 33000
// 22.1.1.3, p5
MEMFUN (std::string, name, () const);
@@ -705,15 +687,11 @@
#endif // _RWSTD_NO_WCHAR_T
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
// exercise a specialization other than on the default char types
typedef StringTypes<int>::string_type IntString;
MEMFUN (bool, operator(), (const IntString&, const IntString&) const);
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
// 22.1.1.5
FUN (std::locale, std::locale::global, (const std::locale&));
FUN (const std::locale&, std::locale::classic, ());
@@ -1075,7 +1053,7 @@
// working around an MSVC 6.0 bug
typedef locale::facet Base;
- _EXPLICIT numpunct (size_t refs = 0)
+ explicit numpunct (size_t refs = 0)
: Base (refs) { /* empty */ }
static locale::id id;
@@ -1558,7 +1536,7 @@
// working around an MSVC 6.0 bug
typedef locale::facet Base;
- _EXPLICIT moneypunct (size_t refs = 0)
+ explicit moneypunct (size_t refs = 0)
: Base (refs), money_base () { /* empty */ }
static locale::id id;
@@ -1588,7 +1566,7 @@
// working around an MSVC 6.0 bug
typedef locale::facet Base;
- _EXPLICIT moneypunct (size_t refs = 0)
+ explicit moneypunct (size_t refs = 0)
: Base (refs), money_base () { /* empty */ }
static locale::id id;