Skip to content

Commit 8c25cf9

Browse files
committed
Remove HAS_STATIC_ASSERT define and simplify at its sole use
1 parent 0c745a8 commit 8c25cf9

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

inst/include/Rcpp/internal/wrap.h

+7-13
Original file line numberDiff line numberDiff line change
@@ -522,18 +522,12 @@ namespace Rcpp {
522522
* quite a cryptic message
523523
*/
524524
template <typename T>
525-
inline SEXP wrap_dispatch_unknown_iterable(const T& object, ::Rcpp::traits::false_type) {
526-
RCPP_DEBUG_1("wrap_dispatch_unknown_iterable<%s>(., false )", DEMANGLE(T))
527-
// here we know that T is not convertible to SEXP
528-
#ifdef HAS_STATIC_ASSERT
529-
static_assert(!sizeof(T), "cannot convert type to SEXP");
530-
#else
531-
// leave the cryptic message
532-
SEXP x = object;
533-
return x;
534-
#endif
535-
return R_NilValue; // -Wall
536-
}
525+
inline SEXP wrap_dispatch_unknown_iterable(const T& object, ::Rcpp::traits::false_type) {
526+
RCPP_DEBUG_1("wrap_dispatch_unknown_iterable<%s>(., false )", DEMANGLE(T))
527+
// here we know that T is not convertible to SEXP
528+
static_assert(!sizeof(T), "cannot convert type to SEXP");
529+
return R_NilValue; // -Wall
530+
}
537531

538532
template <typename T>
539533
inline SEXP wrap_dispatch_unknown_iterable__logical(const T& object, ::Rcpp::traits::true_type) {
@@ -936,7 +930,7 @@ namespace Rcpp {
936930
if (v != NULL)
937931
return Rf_mkString(v);
938932
else
939-
return R_NilValue; // #nocov
933+
return R_NilValue; // #nocov
940934
}
941935

942936
/**

inst/include/Rcpp/platform/compiler.h

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
// C++11 features -- that used to be carefully tested for or worked around via CXX0X / TR1
4141
#define RCPP_USING_CXX11
4242
#define HAS_VARIADIC_TEMPLATES
43-
#define HAS_STATIC_ASSERT
4443
#include <cmath>
4544
#include <initializer_list>
4645
#include <unordered_map>

0 commit comments

Comments
 (0)