The Gaudi Framework
master (5c735ca6)
Toggle main menu visibility
Loading...
Searching...
No Matches
print_limits.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#include <cxxabi.h>
12
#include <iostream>
13
#include <limits>
14
15
template
<
typename
T>
16
void
print_limits_for
() {
17
using
std::cout;
18
int
status;
19
auto
realname = std::unique_ptr<char, decltype( free )*>(
20
abi::__cxa_demangle(
typeid
( T ).name(),
nullptr
,
nullptr
, &status ), free );
21
// the unary '+' is explained in https://stackoverflow.com/a/28414758
22
cout <<
" '"
<< realname.get() <<
"': ("
<< +std::numeric_limits<T>::min() <<
", "
23
<< +std::numeric_limits<T>::max() <<
"),\n"
;
24
}
25
26
void
print_limits
() {
27
using
std::cout;
28
cout <<
"{\n"
;
29
print_limits_for<signed char>
();
30
print_limits_for<short>
();
31
print_limits_for<int>
();
32
print_limits_for<long>
();
33
print_limits_for<long long>
();
34
print_limits_for<unsigned char>
();
35
print_limits_for<unsigned short>
();
36
print_limits_for<unsigned int>
();
37
print_limits_for<unsigned long>
();
38
print_limits_for<unsigned long long>
();
39
cout <<
"}\n"
;
40
}
print_limits
void print_limits()
Definition
print_limits.cpp:26
print_limits_for
void print_limits_for()
Definition
print_limits.cpp:16
GaudiConfiguration
tools
print_limits.cpp
Generated on
for The Gaudi Framework by
1.17.0