Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "harakiri.h"
- OneTimeCallback::OneTimeCallback(const char *s) {
- s_ = std::make_unique<std::string>(std::string(s));
- }
- OneTimeCallback::OneTimeCallback(std::string s) {
- s_ = std::make_unique<std::string>(std::string(s));
- }
- OneTimeCallback::~OneTimeCallback() = default;
- const std::string OneTimeCallback::operator()() const && {
- std::string s = std::move(*s_);
- return s;
- }
- AwesomeCallback::AwesomeCallback(std::string s) : OneTimeCallback(s) {
- }
- AwesomeCallback::AwesomeCallback(const char *s) : OneTimeCallback(s) {
- }
- AwesomeCallback::~AwesomeCallback() = default;
- const std::string AwesomeCallback::operator()() const && {
- std::string s = std::move(*s_);
- s += "awesomeness";
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement