In C++17, is there any difference between declaring a global constant like this:
namespace ns
{
static constexpr const auto global_variable = 47;
}
Specifying the const
modifier as well, and:
namespace ns
{
static constexpr auto global_variable = 47;
}
Without specifying const
? If yes, which are the differences and which version of the declaration is recommended in which scenarios?