22 lines · cpp
1template<typename T, unsigned value>2struct C {3 T member = value;4};5 6C<int, 2> temp1;7 8template <typename T, T value> struct Foo {};9Foo<short, -2> temp2;10Foo<char, 'v'> temp3;11Foo<float, 2.0f> temp4;12Foo<double, -250.5> temp5;13Foo<int *, &temp1.member> temp6;14Foo<_Float16, _Float16(1.0)> temp7;15Foo<__bf16, __bf16(1.0)> temp8;16 17template <typename T, T... values> struct Bar {};18Bar<double, 1.2> temp9;19Bar<float, 1.0f, 2.0f> temp10;20 21int main() {}22