I'd like to define some constants in a c++ program. The excellent boost library has them predefined, and I like to assign my constants these values, e.g. something like
#include <iostream>
#include <boost/units/systems/si/codata/electromagnetic_constants.hpp>
int main(int argc, const char * argv[]) {
double electron_charge = boost::units::si::constants::codata::e;
std::cout << electron_charge << std::endl;
return 0;
}
But this does not work since boost's e is not of type double
but of type value_type
. How can I access the value in double precision?