STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
ratio File Reference
#include <bits/c++0x_warning.h>
#include <ratio>

Macros

#define _GLIBCXX_RATIO   1
 

Functions

namespace std _GLIBCXX_VISIBILITY (default)
 

Detailed Description

This is a TR2 C++ Library header.

Macro Definition Documentation

#define _GLIBCXX_RATIO   1

Function Documentation

namespace std _GLIBCXX_VISIBILITY ( default  )

Add binary prefixes (IEC 60027-2 A.2 and ISO/IEC 80000).

32 {
33 namespace tr2
34 {
35 _GLIBCXX_BEGIN_NAMESPACE_VERSION
36 
37  template<intmax_t _Pn, size_t _Bit,
38  bool = _Bit < static_cast<size_t>
39  (std::numeric_limits<intmax_t>::digits)>
40  struct __safe_lshift
41  { static const intmax_t __value = 0; };
42 
43  template<intmax_t _Pn, size_t _Bit>
44  struct __safe_lshift<_Pn, _Bit, true>
45  { static const intmax_t __value = _Pn << _Bit; };
46 
48  typedef ratio<__safe_lshift<1, 10>::__value, 1> kibi;
49  typedef ratio<__safe_lshift<1, 20>::__value, 1> mebi;
50  typedef ratio<__safe_lshift<1, 30>::__value, 1> gibi;
51  typedef ratio<__safe_lshift<1, 40>::__value, 1> tebi;
52  typedef ratio<__safe_lshift<1, 50>::__value, 1> pebi;
53  typedef ratio<__safe_lshift<1, 60>::__value, 1> exbi;
54  //typedef ratio<__safe_lshift<1, 70>::__value, 1> zebi;
55  //typedef ratio<__safe_lshift<1, 80>::__value, 1> yobi;
56 
57 _GLIBCXX_END_NAMESPACE_VERSION
58 }
59 }
__INTMAX_TYPE__ intmax_t
Definition: stdint-gcc.h:91