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".