Quantcast
Channel: Intel® C++-Compiler
Viewing all articles
Browse latest Browse all 1665

Bug

$
0
0

Usage of static constexpr member-function or member-variable, declared within a template, causes compiler error, if declared member-function or member-variable is further used within the same template.

Platform: Win 7, x86, Intel Parallel Studio 15 Update 6

Example:

template<typename T, int n> class test_template

{

public:

static constexpr int double_sz() {

return 2 * n;

}

T arr[double_sz()];

};

Here static constexpr member-function double_sz() is further used to define the size of array, declared within the same template. Result: compiler error "function call must have a constant value in a constant expression". 

 


Viewing all articles
Browse latest Browse all 1665

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>