Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct TTestData {
- TA A;
- TB B;
- ... // next fields
- };
- struct TTestState : private TTestData {
- ... // some mutable methods
- const TTestData& GetData() const {
- return *static_cast<const TTestData*>(this);
- }
- };
- void SomeTest {
- TTestState test;
- const auto& [a, b, ...] = test.GetData();
- test.MutableMethod1(...)
- .MutableMethod2(...)
- ...
- .MutableMethodN(...);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement