Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.32k stars 3.34k forks source link

Refactor codebase to use std::optional instead of boost::optional #6551

Closed SiarheiFedartsou closed 2 months ago

SiarheiFedartsou commented 1 year ago

Description

We migrated to C++17 and can start using std::optional from standard library instead of boost::optional.

The main problem here is Boost.Spirit library which doesn’t support std::optional(see https://github.com/Project-OSRM/osrm-backend/pull/6429#issuecomment-1296207761).

Kaushik-Iyer commented 1 year ago

Can I try to work on this? Which part of the codebase should I be looking at?

nilsnolde commented 1 year ago

GSoC has an application process, which we will follow. We’ll make an announcement as soon as that starts.

code-sparsh commented 1 year ago

I might be able to work on this. Is it available?

nilsnolde commented 1 year ago

It is. Do you want to be assigned?

97littleleaf11 commented 1 year ago

oops, I already have some progress on this issue

97littleleaf11 commented 1 year ago

@nilsnolde sorry for my previous misguiding comment. @code-sparsh It's fine that you take this issue! I will find another issue to work on later. Actually I haven't dig into the Boost.Spirit yet.

code-sparsh commented 1 year ago

@97littleleaf11 Oh okay. If you already have some progress, it's fair that you take the issue because I haven't started yet.

Regarding the Boost.Spirit, I did some research on it. I think it would require some extra workarounds to be able to support std::optional. That might add some extra boilerplate to the code. I don't know if that's feasible or not, because I am just a beginner in this.

97littleleaf11 commented 1 year ago

@code-sparsh Thanks for your information! Yeah, someone might add a boilerplate for std::optional like this https://github.com/boostorg/spirit/issues/270#issuecomment-376114135 . Also need to check the correct overloading func. I haven't made it and found it's a little bit beyond my ability. It would be fine that you can take this.

mugr1x commented 1 year ago

Hello, I also have some progress on this issue. Can I submit a PR ?

SiarheiFedartsou commented 1 year ago

Hello, I also have some progress on this issue. Can I submit a PR ?

Sure, why not? :)

mugr1x commented 1 year ago

Now I found out that boost::spirit::x3 works well with std::optional (and has only minor modifications needed for working). However is it intentional that one implements a whole CSV parser instead of linking against something like libcsv3 ? Anyway, I also want to apply for Google summer of code. I also think should talk to a potentional menter before. @SiarheiFedartsou Can we possibly chat, you know about what exactly you need for the project idea and if it would be a good fit ?