Skip to content

Commit

Permalink
Merge pull request #11 from lsst/tickets/DM-6090
Browse files Browse the repository at this point in the history
Replace boost::lexical_cast with std equivalent
  • Loading branch information
Pim Schellart authored and Pim Schellart committed Jun 2, 2016
2 parents f0ccc9b + 2eaafa0 commit 621a938
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion include/lsst/utils/RaDecStr.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "boost/format.hpp"
#include "boost/regex.hpp"
#include "boost/lexical_cast.hpp"

#include "lsst/pex/exceptions/Runtime.h"

Expand Down
13 changes: 7 additions & 6 deletions src/RaDecStr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* see <http://www.lsstcorp.org/LegalNotices/>.
*/

#include <string>

#include "lsst/utils/RaDecStr.h"

Expand Down Expand Up @@ -172,9 +173,9 @@ double ut::raStrToDeg(std::string raStr, std::string delimiter) {


//Convert strings to doubles. Again, errors thrown on failure
double hours = boost::lexical_cast<double>(string(what[1].first, what[1].second));
double mins = boost::lexical_cast<double>(string(what[2].first, what[2].second));
double secs = boost::lexical_cast<double>(string(what[3].first, what[3].second));
double hours = std::stod(string(what[1].first, what[1].second));
double mins = std::stod(string(what[2].first, what[2].second));
double secs = std::stod(string(what[3].first, what[3].second));

double raDeg = secs/3600.;
raDeg += mins/60.;
Expand Down Expand Up @@ -211,9 +212,9 @@ double ut::decStrToDeg(std::string decStr, std::string delimiter) {
}

//Convert strings to doubles. Automatically pass the exception up the stack
double degrees = boost::lexical_cast<double>(string(what[1].first, what[1].second));
double mins = boost::lexical_cast<double>(string(what[2].first, what[2].second));
double secs = boost::lexical_cast<double>(string(what[3].first, what[3].second));
double degrees = std::stod(string(what[1].first, what[1].second));
double mins = std::stod(string(what[2].first, what[2].second));
double secs = std::stod(string(what[3].first, what[3].second));

degrees += ((secs/60.) +mins)/60.;

Expand Down

0 comments on commit 621a938

Please sign in to comment.