• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//  (C) Copyright John Maddock 2001.
2//  Use, modification and distribution are subject to the
3//  Boost Software License, Version 1.0. (See accompanying file
4//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6//  See http://www.boost.org/libs/config for most recent version.
7
8//  MACRO:         BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
9//  TITLE:         compile time constants in <limits>
10//  DESCRIPTION:   constants such as numeric_limits<T>::is_signed
11//                 are not available for use at compile-time.
12
13#include <limits>
14
15namespace boost_no_limits_compile_time_constants{
16
17struct UDT{};
18
19template <int i>
20struct assert_ice
21{
22   enum { value = i };
23};
24
25int test()
26{
27   assert_ice< ::std::numeric_limits<int>::is_signed > one;
28   assert_ice< ::std::numeric_limits<double>::is_specialized > two;
29   assert_ice< ::std::numeric_limits<UDT>::is_specialized > three;
30   assert_ice< ::std::numeric_limits<UDT>::is_signed > four;
31   (void)one;
32   (void)two;
33   (void)three;
34   (void)four;
35   return 0;
36}
37
38}
39
40
41
42
43