• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 template <typename T>
3 constexpr T my_pi = T(3.1415926535897932385L);  // variable template
4 
5 template <> constexpr char my_pi<char> = '3';   // variable template specialization
6 
7 template <typename T>
8 struct Wrapper {
9   template <typename U> static constexpr U my_const = U(1);
10    // Variable template partial specialization with member variable.
11   template <typename U> static constexpr U *my_const<const U *> = (U *)(0);
12 };
13 
14 constexpr char a[] = "hello";
15 
16 template <> template <>
17 constexpr const char *Wrapper<float>::my_const<const char *> = a;
18