Guest User

Untitled

a guest
Sep 6th, 2026
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. //Test.h
  2. #include <iostream>
  3. #include <map>
  4. #include <functional>
  5.  
  6. class Test
  7. {
  8. bool ReturnTrue() { return true; }
  9.  
  10. public:
  11. Test();
  12. ~Test();
  13. };
  14.  
  15. //Test.cpp
  16. Test::Test()
  17. {
  18. std::map<std::string, std::function<bool(void)>> map;
  19. map["test"] = ReturnTrue; //throws an E0349 error
  20. map["test"] = [this]() { return ReturnTrue(); }; //Exception thrown at 0xCCCCCCCC during runtime
  21. }
  22.  
  23. Test::~Test()
  24. {
  25. }
Advertisement
Add Comment
Please, Sign In to add comment