Skip to content

Commit 75e5af8

Browse files
committed
Fix formatting
1 parent c783cda commit 75e5af8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cpp11test/src/test-as.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ context("as_cpp-C++") {
9191
}
9292

9393
test_that("as_cpp<enum:char>(INTSEXP)") {
94-
enum class Response: char { YES, NO, MAYBE };
94+
enum class Response : char { YES, NO, MAYBE };
9595
SEXP r = PROTECT(Rf_allocVector(INTSXP, 1));
9696

97-
for (Response e : {Response::YES, Response::NO, Response::MAYBE, static_cast<Response>(42)}) {
97+
for (Response e :
98+
{Response::YES, Response::NO, Response::MAYBE, static_cast<Response>(42)}) {
9899
INTEGER(r)[0] = static_cast<int>(e);
99100
auto x = cpp11::as_cpp<Response>(r);
100101
expect_true(x == e);

inst/include/cpp11/as.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ template <typename E>
9797
enable_if_enum<E, E> as_cpp(SEXP from) {
9898
if (Rf_isInteger(from)) {
9999
using underlying_type = typename std::underlying_type<E>::type;
100-
using int_type = typename std::conditional<
101-
std::is_same<char, underlying_type>::value,
102-
int, // as_cpp<char> would trigger undesired string conversions
103-
underlying_type
104-
>::type;
100+
using int_type = typename std::conditional<std::is_same<char, underlying_type>::value,
101+
int, // as_cpp<char> would trigger
102+
// undesired string conversions
103+
underlying_type>::type;
105104
return static_cast<E>(as_cpp<int_type>(from));
106105
}
107106

0 commit comments

Comments
 (0)