Skip to content

Commit 344b257

Browse files
committed
remove special code to support C++11
Don't use the macros - BOOST_NO_DELETED_FUNCTIONS - BOOST_NO_EXPLICIT_CONVERSION_OPERATORS - BOOST_NO_VARIADIC_TEMPLATES anymore because all compiler support those features now (https://en.cppreference.com/w/cpp/compiler_support/11).
1 parent 306a647 commit 344b257

File tree

5 files changed

+7
-41
lines changed

5 files changed

+7
-41
lines changed

include/cucumber-cpp/internal/RegistrationMacros.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef CUKE_REGISTRATIONMACROS_HPP_
22
#define CUKE_REGISTRATIONMACROS_HPP_
33

4+
#include <boost/config/helper_macros.hpp>
5+
46
// ************************************************************************** //
57
// ************** OBJECT NAMING MACROS ************** //
68
// ************************************************************************** //

include/cucumber-cpp/internal/hook/HookRegistrar.hpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
#include "../Scenario.hpp"
77
#include "../step/StepManager.hpp"
88

9-
#include <boost/config.hpp>
109
#include <memory>
11-
1210
#include <list>
1311

1412
namespace cucumber {
@@ -102,11 +100,7 @@ class CUCUMBER_CPP_EXPORT HookRegistrar {
102100

103101
private:
104102
// We're a singleton so don't allow instances
105-
HookRegistrar()
106-
#ifndef BOOST_NO_DELETED_FUNCTIONS
107-
= delete
108-
#endif
109-
;
103+
HookRegistrar() = delete;
110104
};
111105

112106
class CUCUMBER_CPP_EXPORT StepCallChain {

include/cucumber-cpp/internal/step/StepManager.hpp

+3-23
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66
#include <stdexcept>
77
#include <string>
88
#include <vector>
9-
10-
#include <boost/config.hpp>
119
#include <memory>
12-
13-
#ifndef BOOST_NO_VARIADIC_TEMPLATES
14-
#include <type_traits>
15-
#endif
10+
#include <type_traits>
1611

1712
#include <cucumber-cpp/internal/CukeExport.hpp>
1813
#include "../Table.hpp"
@@ -43,10 +38,7 @@ class CUCUMBER_CPP_EXPORT MatchResult {
4338
const match_results_type& getResultSet();
4439
void addMatch(SingleStepMatch match);
4540

46-
#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
47-
explicit
48-
#endif
49-
operator bool() const;
41+
explicit operator bool() const;
5042

5143
private:
5244
match_results_type resultSet;
@@ -139,13 +131,6 @@ class CUCUMBER_CPP_EXPORT BasicStep {
139131
const T getInvokeArg();
140132
const InvokeArgs* getArgs();
141133

142-
#ifdef BOOST_NO_VARIADIC_TEMPLATES
143-
// Special case for zero arguments, only thing we bother to support on C++98
144-
template<typename Derived, typename R>
145-
static R invokeWithArgs(Derived& that, R (Derived::*f)()) {
146-
return (that.*f)();
147-
}
148-
#else
149134
template<typename Derived, typename R, typename... Args, std::size_t... N>
150135
static R invokeWithIndexedArgs(Derived& that, R (Derived::*f)(Args...), index_sequence<N...>) {
151136
return (that.*f)(that.pArgs->template getInvokeArg<typename std::decay<Args>::type>(N)...);
@@ -156,7 +141,6 @@ class CUCUMBER_CPP_EXPORT BasicStep {
156141
that.currentArgIndex = sizeof...(Args);
157142
return invokeWithIndexedArgs(that, f, index_sequence_for<Args...>{});
158143
}
159-
#endif
160144

161145
private:
162146
// FIXME: awful hack because of Boost::Test
@@ -188,11 +172,7 @@ class CUCUMBER_CPP_EXPORT StepManager {
188172

189173
private:
190174
// We're a singleton so don't allow instances
191-
StepManager()
192-
#ifndef BOOST_NO_DELETED_FUNCTIONS
193-
= delete
194-
#endif
195-
;
175+
StepManager() = delete;
196176
};
197177

198178
static inline std::string toSourceString(const char* filePath, const int line) {
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#ifndef CUKE_INDEXSEQ_HPP_
22
#define CUKE_INDEXSEQ_HPP_
33

4-
#include <boost/config.hpp>
5-
6-
#ifndef BOOST_NO_VARIADIC_TEMPLATES
7-
8-
#include <utility>
4+
#include <utility>
95

106
namespace cucumber {
117
namespace internal {
@@ -16,6 +12,4 @@ using ::std::index_sequence_for;
1612
}
1713
}
1814

19-
#endif /* !BOOST_NO_VARIADIC_TEMPLATES */
20-
2115
#endif /* CUKE_INDEXSEQ_HPP_ */

tests/unit/CukeCommandsTest.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include <cucumber-cpp/internal/step/StepMacros.hpp>
44
#include "utils/CukeCommandsFixture.hpp"
55

6-
#include <boost/config.hpp>
7-
86
using namespace cucumber::internal;
97

108
using std::string;
@@ -77,7 +75,6 @@ class CheckAllParametersWithMacro : public CheckAllParameters {
7775
}
7876
};
7977

80-
#ifndef BOOST_NO_VARIADIC_TEMPLATES
8178
class CheckAllParametersWithFuncArgs : public CheckAllParameters {
8279
public:
8380
void bodyWithArgs(
@@ -101,7 +98,6 @@ TEST_F(CukeCommandsTest, invokeHandlesParametersWithFuncArgs) {
10198
// The real test is in TestClass::body()
10299
runStepBodyTest<CheckAllParametersWithFuncArgs>();
103100
}
104-
#endif
105101

106102
TEST_F(CukeCommandsTest, matchesCorrectly) {
107103
addStepWithMatcher(STATIC_MATCHER);

0 commit comments

Comments
 (0)