Last active
June 17, 2020 23:00
-
-
Save jeremyroman/0b31f7f91ee310c086cd48294990361e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AssociatedFrobnicator : public base::SupportsUserData::Data { | |
public: | |
Frobnicator* frobnicator() const { return frobnicator_; } | |
void set_frobnicator(Frobnicator* frobnicator) const { frobnicator_ = frobnicator; } | |
private: | |
Frobnicator* frobnicator_; | |
}; | |
base::SupportsUserData::Data* data; | |
static_cast<AssociatedFrobnicator*>(data)->set_frobnicator(new_frobnicator); | |
std::any& data; | |
any_cast<Frobnicator*&>(data) = new_frobnicator; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment