Why do all concrete templates have a parameter called Rep? What are the benefits of factoring out Representation?
A25: All Resolve/C++ concrete templates (with the rare exception of the ones implemented in native C++) have a template parameter called Rep. The actual parameter is required to be an instance of Representation component and is used as the representation of the concrete template. Compared to the traditional C++ approach of using private data fields for representation, this schema has several important benefits. First, the memory management strategy for the representation fields is factored out and encapsulated in the Representation component. This significantly improves performance without jeopardizing correctness or simplicity. Second, the swap operator and Clear operation are inherited and re-exported by the concrete template. Finally, this schema makes the representation fields access syntax uniform with the access syntax of record fields.