New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-15809: Replace boost::regex with std::regex #59
Conversation
e176e3d
to
121b09c
Compare
include/lsst/utils/RaDecStr.h
Outdated
|
||
#ifndef RA_DEC_STR_H | ||
#define RA_DEC_STR_H | ||
|
||
#include <string> | ||
#include <cmath> | ||
#include <regex> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, doesn't look like this is even needed in this header file. It should move to the .cc file, no?
src/RaDecStr.cc
Outdated
@@ -184,8 +184,8 @@ double sexagesimalStrToDecimal( | |||
|
|||
//Search for leading - sign. | |||
std::string pmStr = "^-"; | |||
static const boost::regex pm(pmStr); | |||
if(boost::regex_search(inStr, pm)) | |||
static const std::regex pm(pmStr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit excessive for checking the first character.
src/RaDecStr.cc
Outdated
//This throws an exception of failure. I could catch it, | ||
//but I'd only throw it again | ||
if(! boost::regex_search(inStr.c_str(), what, re)) { | ||
if(! std::regex_search(inStr.c_str(), what, re)) { | ||
std::string msg= boost::str(boost::format( | ||
"Failed to parse %s as a right ascension or declination with regex %s") | ||
% inStr % regexStr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below, I believe std::cmatch
supports what[1].str()
to simplify the conversions.
#62 is going to supersede this PR to a certain extent. I'll revisit it once the radec stuff has been removed. |
121b09c
to
ccc10e5
Compare
@ktlim I've redone this ticket now that the original raDecStr.cc code has been removed. Not sure if you want a second look since all the code you previously commented on has gone now. |
No description provided.