Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Test.h
- #include <iostream>
- #include <map>
- #include <functional>
- class Test
- {
- bool ReturnTrue() { return true; }
- public:
- Test();
- ~Test();
- };
- //Test.cpp
- Test::Test()
- {
- std::map<std::string, std::function<bool(void)>> map;
- map["test"] = ReturnTrue; //throws an E0349 error
- map["test"] = [this]() { return ReturnTrue(); }; //Exception thrown at 0xCCCCCCCC during runtime
- }
- Test::~Test()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment