Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Support for C++14 Variable Templates

Here are some updates on the progress on variable templates and some questions concerning the implementation.

I’ve succeeded to implement most parts of binding resolution for variable templates. Furthermore, there are now PDOM bindings for variable and field templates. Reusing most parts of the class template resolution logic has been surprisingly easy :)

Currently, I use the following class hierarchy to represent bindings of templates, instances, specializations and partial specializations:

Inline-Bild 2

ICPPPartiallySpecializable abstracts over class and variable templates which can both be partially specialized. Accordingly, there is ICPPPartialSpecialization to represent partial specializations of classes and variables.

Some questions about this design:

- What public interfaces are needed? For example, do we need a ICPPFieldInstance?
- Is creating redundant classes/interfaces for variables and fields reasonable? At one hand, this corresponds to the current hierarchy of functions and methods and adds to the existing ICPPField hierarchy. On the other hand, it leads to a lot of duplicated code. Furthermore, the distinction between members and globals does not exist for classes.
- Does every binding class need a corresponding PDOM and Composite binding or are there cases that allow to reuse those for multiple binding types?


Regards,

Lukas

Back to the top