Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class A, class B>
- class MyMaps
- {
- private:
- std::shared_ptr<A> aa;
- std::shared_ptr<B> bb;
- public:
- MyMaps() { }
- MyMaps(std::shared_ptr<A> a, std::shared_ptr<B> b :
- aa(a), bb(b) { }
- void operator()() {
- cout << "operator()()" << endl;
- }
- };
- std::unique_ptr<MyMaps<AMap, BMap>> c;
- a = make_shared<AMap>();
- b = make_shared<BMap>();
- c = std::unique_ptr<MyMaps<AMap, BMap>> {
- new MyMaps<AMap, BMap>(a, b)
- };
- /* How does one call the MyMaps functor using std::thread?
- The following creates some pretty large errors. Is this
- even close to correct? */
- std::thread t(MyMaps<AMap, BMap>(), std::move(c));
Advertisement
Add Comment
Please, Sign In to add comment