Suppose I have this struct
struct MyStruct {
  static MyStruct Create(int x) {
    return { x*2, x>3 };
  }
  MyStruct(const MyStruct& c) = delete;  // no copy c'tor
private:
  MyStruct(int a_, bool b_) : a(a_), b(b_) {}  // private c'tor -- can't use new
  const int a;
  const bool b;
};
Edit: I deleted the copy constructor. This is simplified example of some classes I have in my codebase where they don't have copy c'tors.
I can get an instance on the stack like so:
int main() {
  auto foo = MyStruct::Create(2);
  return 0;
}
But suppose I need a pointer instead (or unique_ptr is fine), and I can't change the implementation of MyStruct, how can I do that?
 
     
     
     
    