Skip to content

Commit f9b4bc9

Browse files
committed
Using std::decay_t
1 parent 4236b8a commit f9b4bc9

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

provides/include/testing_v1/private.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ template <class Action> class testing_v1::Private::test_t : test_base_t {
3939

4040
void run() override;
4141

42-
std::conditional_t<std::is_function_v<Action>, Action *, Action> action;
42+
Action action;
4343
};

provides/include/testing_v1/synopsis.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ template <class Action> struct test_t : Private::test_t<Action> {
2121

2222
/// Creates and registers a test action and should only be used at namespace
2323
/// scope.
24-
template <class Action>
25-
test_t<std::remove_cvref_t<Action>> test(Action &&action);
24+
template <class Action> test_t<std::decay_t<Action>> test(Action &&action);
2625

2726
/// Prints `FAIL` and `exit(1)`s the program if the result is false.
2827
void verify(bool result);

provides/include/testing_v1/test.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ testing_v1::test_t<Action>::test_t(ForwardableAction &&action)
1919
: Private::test_t<Action>(std::forward<ForwardableAction>(action)) {}
2020

2121
template <class Action>
22-
testing_v1::test_t<std::remove_cvref_t<Action>>
23-
testing_v1::test(Action &&action) {
24-
return test_t<std::remove_cvref_t<Action>>(std::forward<Action>(action));
22+
testing_v1::test_t<std::decay_t<Action>> testing_v1::test(Action &&action) {
23+
return test_t<std::decay_t<Action>>(std::forward<Action>(action));
2524
}

0 commit comments

Comments
 (0)