While I run make build
for the project DeSiNe, I am getting the error: a call to a constructor cannot appear in a constant-expression
$ make build
mkdir -m 755 -p obj/Algorithm
g++ -Wall -DNO_TIMER -DNO_TRACES -O3 -funroll-loops -finline-functions -fexpensive-optimizations -Isrc -o obj/Algorithm/Algorithm.o -c src/Algorithm/Algorithm.cpp
src/Network/Link.h:44:42: error: a call to a constructor cannot appear in a constant-expression
static const double METRIC_MIN = 1.0/DBL_MAX; // to prevent metric to be 0
^
src/Network/Link.h:45:38: error: a call to a constructor cannot appear in a constant-expression
static const double METRIC_MAX = DBL_MAX;
^
As per Call to a constructor cannot appear in a constant-expression if I change the code in side the Link
class definition in Network\Link.h
from
static const double METRIC_MIN = 1.0/DBL_MAX; // to prevent metric to be 0
static const double METRIC_MAX = DBL_MAX;
to
static const double METRIC_MIN; // to prevent metric to be 0
double METRIC_MIN = 1.0/DBL_MAX;
static const double METRIC_MAX;
double METRIC_MAX = DBL_MAX;
I receive
error: ‘double Link::METRIC_MIN’ conflicts with a previous declaration
double METRIC_MIN = 1.0/DBL_MAX;