This patch adds a new API to `SBType` to retrieve the value of a template parameter given an index. We re-use the `TypeSystemClang::GetIntegralTemplateArgument` for this and thus currently only supports integral non-type template parameters. Types like float/double are not supported yet. rdar://144395216
14 lines
219 B
C++
14 lines
219 B
C++
template<typename T, unsigned value>
|
|
struct C {
|
|
T member = value;
|
|
};
|
|
|
|
C<int, 2> temp1;
|
|
|
|
template <typename T, T value> struct Foo {};
|
|
Foo<short, -2> temp2;
|
|
Foo<char, 'v'> temp3;
|
|
Foo<float, 2.0f> temp4;
|
|
|
|
int main() {}
|