Consider the source snippet
The code today is not extensible because it's structured around the default - hw_default_type which works for 'most' cases. I'm trying to modify source such that I could use the composite type hw_register_struct_type (commented out in main) and hw_default_type as parameters within the same code base. How could I achieve this?Code:typedef hw_default < volatile unsigned short > hw_default_type; typedef hw_register_struct < volatile unsigned short, some_other_policy < unsigned short >, 0x500, 0 > hw_register_struct_type; int main() { unsigned short aa ( 0 ); foo < volatile unsigned short, 5, 6 > aa5_6 ( aa ); hw_default_type ab ; foo < hw_default_type, 5, 6 > ab5_6 ( ab ); //hw_register_struct_type ac ; //foo < hw_register_struct_type, 5, 6 > ac5_6 ( ac ); }




Reply With Quote