Skip to content

Fix compilation with C++17 (Clang) #325 - #326

Merged
oschulz merged 3 commits into
bat:masterfrom
gipert:master
Sep 18, 2019
Merged

oschulz merged 3 commits into
bat:masterfrom
gipert:master

Conversation

@gipert

@gipert gipert commented May 19, 2019

Copy link
Copy Markdown
Contributor

Replace deprecated std::ptr_fun with lambda function. Makes BAT compilable with -std=c++17 on my Mac.

Replace deprecated std::ptr_fun with lambda function
@gipert

gipert commented May 20, 2019

Copy link
Copy Markdown
Contributor Author

The Travis build is failing because C++11 isn't explicitly enabled during compilation with gcc 4.8. I'll remove the lamba function... or you prefer to require C++11?

@oschulz
oschulz requested a review from fredRos May 21, 2019 08:46
@oschulz

oschulz commented May 21, 2019

Copy link
Copy Markdown
Member

Hm, so far we didn't require C++11, so maybe better not require it just for this.

@fredRos

fredRos commented May 22, 2019

Copy link
Copy Markdown
Contributor

Yeah, we decided to use only C++03 in BAT for 1.0 at some point for backwards compatibility. I"m not sure anyone these days has this requirement, though. If you compile BAT with root6, c++11 is used anyways to compile BAT as well.
I'm open to using new features, especially to support up-to-date projects. We just need to state it in our requirements. For this little fix, a preprocessor conditional should be enough to support both old and new.
I open an issue so we build BAT on travis with c++03, c++11, and c++17. I guess could add c++14 as well

@oschulz

oschulz commented Aug 30, 2019

Copy link
Copy Markdown
Member

@gipert, is this ready to merge, from your side?

@gipert

gipert commented Aug 30, 2019

Copy link
Copy Markdown
Contributor Author

Yep!

@oschulz

oschulz commented Aug 31, 2019

Copy link
Copy Markdown
Member

@fredRos, @greenwald, any objections?

@fredRos fredRos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, I"d just add linebreaks to be consistent with the rest of the code like

if () 
 erase
else ()
...

@oschulz
oschulz merged commit 095706f into bat:master Sep 18, 2019
@oschulz

oschulz commented Sep 18, 2019

Copy link
Copy Markdown
Member

Thanks, @gipert !

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.

3 participants