Commit ca6c4418 by Gabriel Dos Reis Committed by Gabriel Dos Reis

* include/bits/cpp_type_traits.h: Fix typos. Adjust formatting.

From-SVN: r37373
parent 982b8443
2000-11-10 Gabriel Dos Reis <gdr@codesourcery.com> 2000-11-10 Gabriel Dos Reis <gdr@codesourcery.com>
* include/bits/cpp_type_traits.h: Fix typos. Adjust formatting.
2000-11-10 Gabriel Dos Reis <gdr@codesourcery.com>
* include/bits/localefwd.h (_Count_ones<>::_S_halfcount, * include/bits/localefwd.h (_Count_ones<>::_S_halfcount,
_Count_ones<>::_S_count): Turn into enumerators. _Count_ones<>::_S_count): Turn into enumerators.
......
...@@ -34,47 +34,48 @@ ...@@ -34,47 +34,48 @@
// //
// This file provides some compile-time information about various types. // This file provides some compile-time information about various types.
// These informations were designed, on purpose, to be constant-expressions // These representations were designed, on purpose, to be constant-expressions
// and not types as found in <stl/bits/type_traits.h>. In particular, they // and not types as found in <stl/bits/type_traits.h>. In particular, they
// can be used in control structures and the optimizer hopefully will do // can be used in control structures and the optimizer hopefully will do
// the obvious thing. // the obvious thing.
// //
// Why integral expressions, and not functions nor types? // Why integral expressions, and not functions nor types?
// Firstly, these compile-time information entities are used as // Firstly, these compile-time entities are used as template-arguments
// template-arguments so function return values won't work. We // so function return values won't work: We need compile-time entities.
// need compile-time entities. We're left with types and constant // We're left with types and constant integral expressions.
// integral expressions. // Secondly, from the point of view of ease of use, type-based compile-time
// Secondly, from the point of view of ease of use type-based compile-time
// information is -not- *that* convenient. On has to write lots of // information is -not- *that* convenient. On has to write lots of
// overloaded functions and to hope that the compiler will select the right // overloaded functions and to hope that the compiler will select the right
// one. As a net effect, the overall structure isn't very clear at first // one. As a net effect, the overall structure isn't very clear at first
// glance. // glance.
// Thirdly, partial ordering and overload resolution (of template functions) // Thirdly, partial ordering and overload resolution (of function templates)
// is very costly in terms of compiler-resource. It is a Good Thing to // is highly costly in terms of compiler-resource. It is a Good Thing to
// keep these resource consumption as least as possible. // keep these resource consumption as least as possible.
// //
// See valarray_array.h for a case use.
//
// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06. // -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
// //
namespace std { namespace std
{
template<typename _Tp> template<typename _Tp>
struct __is_void struct __is_void
{
enum
{ {
_M_type = 0 enum
{
_M_type = 0
};
}; };
};
template<> template<>
struct __is_void<void> struct __is_void<void>
{
enum
{ {
_M_type = 1 enum
{
_M_type = 1
};
}; };
};
// //
// Integer types // Integer types
...@@ -292,10 +293,3 @@ namespace std { ...@@ -292,10 +293,3 @@ namespace std {
#endif //_CPP_BITS_CPP_TYPE_TRAITS_H #endif //_CPP_BITS_CPP_TYPE_TRAITS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment