I am trying to initialize a constexpr declaration with a pointer to an int, which is a const object. I am also trying to define an object with an object that is not of type const.
the code:
g ++ log:
constexpr.cc:8:27: error: '& i' is not a constant expression constexpr.cc:9:22: error: '& j' is not a constant expression
I believe this is because objects basically do not have fixed addresses, so g ++ returns me error messages; how to fix it? Without the use of literals.
TheBlueCat
source share