Skip to content
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

Merged
merged 2 commits into from Sep 25, 2018
Merged

Conversation

timj
Copy link
Member

@timj timj commented Sep 20, 2018

No description provided.


#ifndef RA_DEC_STR_H
#define RA_DEC_STR_H

#include <string>
#include <cmath>
#include <regex>
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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.

@timj
Copy link
Member Author

timj commented Sep 24, 2018

#62 is going to supersede this PR to a certain extent. I'll revisit it once the radec stuff has been removed.

@timj
Copy link
Member Author

timj commented Sep 24, 2018

@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.

@timj timj merged commit bca2faa into master Sep 25, 2018
@timj timj deleted the tickets/DM-15809 branch September 25, 2018 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants