diff options
Diffstat (limited to 'Tests/CompileFeatures/cxx_variable_templates.cpp')
-rw-r--r-- | Tests/CompileFeatures/cxx_variable_templates.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/CompileFeatures/cxx_variable_templates.cpp b/Tests/CompileFeatures/cxx_variable_templates.cpp new file mode 100644 index 0000000..5d4bdbc --- /dev/null +++ b/Tests/CompileFeatures/cxx_variable_templates.cpp @@ -0,0 +1,10 @@ + +template<typename T> +constexpr T pi = T(3.1415926535897932385); + +int someFunc() +{ + auto pi_int = pi<int>; + auto pi_float = pi<float>; + return pi_int - 3; +} |