Rcpp Version 1.0.14
Loading...
Searching...
No Matches
is_arithmetic.h
Go to the documentation of this file.
1// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3//
4// is_wide_string.h: Rcpp R/C++ interface class library -- traits to help wrap
5//
6// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
7//
8// This file is part of Rcpp.
9//
10// Rcpp is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 2 of the License, or
13// (at your option) any later version.
14//
15// Rcpp is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
22
23#ifndef Rcpp__traits__is_arithmetic__h
24#define Rcpp__traits__is_arithmetic__h
25
26namespace Rcpp{
27namespace traits{
28
29 template<typename>
30 struct is_arithmetic : public false_type { };
31
32 template<>
33 struct is_arithmetic<short> : public true_type { };
34
35 template<>
36 struct is_arithmetic<const short> : public true_type { };
37
38 template<>
39 struct is_arithmetic<unsigned short> : public true_type { };
40
41 template<>
43
44 template<>
45 struct is_arithmetic<int> : public true_type { };
46
47 template<>
48 struct is_arithmetic<const int> : public true_type { };
49
50 template<>
51 struct is_arithmetic<unsigned int> : public true_type { };
52
53 template<>
55
56 template<>
57 struct is_arithmetic<long> : public true_type { };
58
59 template<>
60 struct is_arithmetic<const long> : public true_type { };
61
62 template<>
63 struct is_arithmetic<unsigned long> : public true_type { };
64
65 template<>
67
68#if defined(RCPP_HAS_LONG_LONG_TYPES)
69
70 template<>
71 struct is_arithmetic<rcpp_long_long_type> : public true_type { };
72
73 template<>
74 struct is_arithmetic<const rcpp_long_long_type> : public true_type { };
75
76 template<>
77 struct is_arithmetic<rcpp_ulong_long_type> : public true_type { };
78
79 template<>
80 struct is_arithmetic<const rcpp_ulong_long_type> : public true_type { };
81
82#endif
83
84 template<>
85 struct is_arithmetic<float> : public true_type { };
86
87 template<>
88 struct is_arithmetic<const float> : public true_type { };
89
90 template<>
91 struct is_arithmetic<double> : public true_type { };
92
93 template<>
94 struct is_arithmetic<const double> : public true_type { };
95
96 template<>
97 struct is_arithmetic<long double> : public true_type { };
98
99 template<>
101
102} // traits
103} // Rcpp
104
105#endif
integral_constant< bool, true > true_type
Rcpp API.
Definition algo.h:28
T as(SEXP x)
Definition as.h:151