~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to boost/boost/type_traits/is_scalar.hpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
 
3
// Permission to copy, use, modify, sell and
 
4
// distribute this software is granted provided this copyright notice appears
 
5
// in all copies. This software is provided "as is" without express or implied
 
6
// warranty, and with no claim as to its suitability for any purpose.
 
7
//
 
8
// See http://www.boost.org for most recent version including documentation.
 
9
 
 
10
#ifndef BOOST_TT_IS_SCALAR_HPP_INCLUDED
 
11
#define BOOST_TT_IS_SCALAR_HPP_INCLUDED
 
12
 
 
13
#include "boost/type_traits/is_arithmetic.hpp"
 
14
#include "boost/type_traits/is_enum.hpp"
 
15
#include "boost/type_traits/is_pointer.hpp"
 
16
#include "boost/type_traits/is_member_pointer.hpp"
 
17
#include "boost/type_traits/detail/ice_or.hpp"
 
18
#include "boost/config.hpp"
 
19
 
 
20
// should be the last #include
 
21
#include "boost/type_traits/detail/bool_trait_def.hpp"
 
22
 
 
23
namespace boost {
 
24
 
 
25
namespace detail {
 
26
 
 
27
template <typename T>
 
28
struct is_scalar_impl
 
29
 
30
   BOOST_STATIC_CONSTANT(bool, value =
 
31
      (::boost::type_traits::ice_or<
 
32
         ::boost::is_arithmetic<T>::value,
 
33
         ::boost::is_enum<T>::value,
 
34
         ::boost::is_pointer<T>::value,
 
35
         ::boost::is_member_pointer<T>::value
 
36
      >::value));
 
37
};
 
38
 
 
39
// these specializations are only really needed for compilers 
 
40
// without partial specialization support:
 
41
template <> struct is_scalar_impl<void>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
 
42
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
 
43
template <> struct is_scalar_impl<void const>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
 
44
template <> struct is_scalar_impl<void volatile>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
 
45
template <> struct is_scalar_impl<void const volatile>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
 
46
#endif
 
47
 
 
48
} // namespace detail
 
49
 
 
50
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_scalar,T,::boost::detail::is_scalar_impl<T>::value)
 
51
 
 
52
} // namespace boost
 
53
 
 
54
#include "boost/type_traits/detail/bool_trait_undef.hpp"
 
55
 
 
56
#endif // BOOST_TT_IS_SCALAR_HPP_INCLUDED