Skip to content

Commit ddf229b

Browse files
committed
Use variadic templates unconditionally in traits/index_sequece.h
and traits/named_object.h
1 parent 2b3a93c commit ddf229b

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* inst/include/Rcpp/internal/call.h: Idem
99
* inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem
1010
* inst/include/Rcpp/Module.h: Idem
11+
* inst/include/Rcpp/traits/index_sequence.h: Idem
12+
* inst/include/Rcpp/traits/named_object.h: Idem
1113

1214
* inst/include/Rcpp/module/Module_generated_class_constructor.h: Removed
1315
* inst/include/Rcpp/module/Module_generated_class_factory.h: Idem

inst/include/Rcpp/traits/index_sequence.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#ifndef RCPP_TRAITS_INDEX_SEQUENCE_H
22
#define RCPP_TRAITS_INDEX_SEQUENCE_H
33

4-
5-
#if defined(HAS_VARIADIC_TEMPLATES)
6-
74
namespace Rcpp {
85
namespace traits {
96
/**
@@ -23,5 +20,3 @@ namespace traits {
2320
}
2421

2522
#endif
26-
27-
#endif

inst/include/Rcpp/traits/named_object.h

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// named_object.h: Rcpp R/C++ interface class library -- named SEXP
33
//
44
// Copyright (C) 2010 - 2020 Dirk Eddelbuettel and Romain Francois
5-
// Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
5+
// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
66
//
77
// This file is part of Rcpp.
88
//
@@ -65,18 +65,15 @@ template <typename T> struct is_named : public false_type{};
6565
template <typename T> struct is_named< named_object<T> > : public true_type {};
6666
template <> struct is_named< Rcpp::Argument > : public true_type {};
6767

68+
template <typename... T> struct is_any_named : public false_type {};
69+
template <typename T> struct is_any_named<T> : public is_named<T>::type {};
6870

69-
#if defined(HAS_VARIADIC_TEMPLATES)
70-
template <typename... T> struct is_any_named : public false_type {};
71-
template <typename T> struct is_any_named<T> : public is_named<T>::type {};
72-
73-
template <typename T, typename... TArgs>
74-
struct is_any_named<T, TArgs...>
75-
: public std::conditional<
76-
is_any_named<T>::value,
77-
std::true_type,
78-
is_any_named<TArgs...>>::type {};
79-
#endif
71+
template <typename T, typename... TArgs>
72+
struct is_any_named<T, TArgs...>
73+
: public std::conditional<
74+
is_any_named<T>::value,
75+
std::true_type,
76+
is_any_named<TArgs...>>::type {};
8077

8178
} // namespace traits
8279
} // namespace Rcpp

0 commit comments

Comments
 (0)