comparison armadillo-3.900.4/include/armadillo_bits/arma_static_check.hpp @ 49:1ec0e2823891

Switch to using subrepo copies of qm-dsp, nnls-chroma, vamp-plugin-sdk; update Armadillo version; assume build without external BLAS/LAPACK
author Chris Cannam
date Thu, 13 Jun 2013 10:25:24 +0100
parents
children
comparison
equal deleted inserted replaced
48:69251e11a913 49:1ec0e2823891
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2011 Conrad Sanderson
3 //
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8
9 //! \addtogroup arma_static_check
10 //! @{
11
12
13
14 template<bool ERROR___INCORRECT_OR_UNSUPPORTED_TYPE>
15 struct arma_type_check_cxx1998
16 {
17 arma_inline
18 static
19 void
20 apply()
21 {
22 static const char
23 junk[ ERROR___INCORRECT_OR_UNSUPPORTED_TYPE ? -1 : +1 ];
24 }
25 };
26
27
28
29 template<>
30 struct arma_type_check_cxx1998<false>
31 {
32 arma_inline
33 static
34 void
35 apply()
36 {
37 }
38 };
39
40
41
42 #if !defined(ARMA_USE_CXX11)
43
44 #define arma_static_check(condition, message) static const char message[ (condition) ? -1 : +1 ]
45
46 #define arma_type_check(condition) arma_type_check_cxx1998<condition>::apply()
47
48 #else
49
50 #define arma_static_check(condition, message) static_assert( !(condition), #message )
51
52 #define arma_type_check(condition) static_assert( !(condition), "error: incorrect or unsupported type" )
53
54 #endif
55
56
57
58 //! @}