diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2017-12-14 18:31:59 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-01-16 16:59:45 -0500 |
commit | a8561f9a3775083eaf17e648850791a2cbd37893 (patch) | |
tree | b8c03bf13d71d1a2aea1206c5153104016219b52 /src | |
parent | f2af0ad889f1cfca7a311d53912c5b808500ea77 (diff) | |
download | mongo-a8561f9a3775083eaf17e648850791a2cbd37893.tar.gz |
SERVER-32070 remove stdx::bind (final patch)
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/stdx/functional.h | 8 | ||||
-rw-r--r-- | src/mongo/unittest/unittest.h | 24 |
2 files changed, 12 insertions, 20 deletions
diff --git a/src/mongo/stdx/functional.h b/src/mongo/stdx/functional.h index 0921cd22c94..e489c1d4edd 100644 --- a/src/mongo/stdx/functional.h +++ b/src/mongo/stdx/functional.h @@ -33,11 +33,9 @@ namespace mongo { namespace stdx { -using ::std::bind; // NOLINT -using ::std::cref; // NOLINT -using ::std::function; // NOLINT -using ::std::ref; // NOLINT -namespace placeholders = ::std::placeholders; // NOLINT +using ::std::cref; // NOLINT +using ::std::function; // NOLINT +using ::std::ref; // NOLINT } // namespace stdx } // namespace mongo diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index 1913e7a9197..b20cb81c93e 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -383,14 +383,20 @@ public: add<T>(demangleName(typeid(T))); } - template <class T, typename A> + template <class T, class A> void add(const A& a) { - add(demangleName(typeid(T)), stdx::bind(&Suite::runTestObjectWithArg<T, A>, a)); + add(demangleName(typeid(T)), [a] { + T testObj(a); + testObj.run(); + }); } template <class T> void add(const std::string& name) { - add(name, &Suite::runTestObject<T>); + add(name, [] { + T testObj; + testObj.run(); + }); } void add(const std::string& name, const TestFunction& testFn); @@ -416,18 +422,6 @@ private: // TODO(C++11): Make this hold unique_ptrs. typedef std::vector<std::shared_ptr<TestHolder>> TestHolderList; - template <typename T> - static void runTestObject() { - T testObj; - testObj.run(); - } - - template <typename T, typename A> - static void runTestObjectWithArg(const A& a) { - T testObj(a); - testObj.run(); - } - std::string _name; TestHolderList _tests; bool _ran; |