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

Remove Boost Dependency #70

Closed
ax3l opened this issue Feb 15, 2018 · 7 comments
Closed

Remove Boost Dependency #70

ax3l opened this issue Feb 15, 2018 · 7 comments

Comments

@ax3l
Copy link
Member

ax3l commented Feb 15, 2018

Please replace boost MPL lists with mp11 lists.
Requires Boost 1.66.0+

Update: oh wait, that is only boost variant you are controlling, right?

Anyway, careful with global BOOST_MPL_ defines in-code! Better set them in CMake as PUBLIC target properties since downstream code might use BOOST_MPL as well! (and the compile-time impact of BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS might be big).

There are also other C++11 libs of variant that we could consider to use in order to avoid Boost::MPL modifications.

Possible candidates for C++11 variants:

Possible replacements for C++11 filesystem (we require directory traversal, listing and creation):

@ax3l ax3l changed the title Boost MPL -> mp11 Boost: Variadic & MPL -> mp11 Feb 15, 2018
@ax3l ax3l changed the title Boost: Variadic & MPL -> mp11 Boost: Variadic & MPL Feb 15, 2018
@ax3l ax3l changed the title Boost: Variadic & MPL Boost: Variadic (& MPL) Feb 15, 2018
@C0nsultant
Copy link
Member

C0nsultant commented Feb 16, 2018

Yes, those #defines are there to increase the default limit of MPL lists.

Agreed, it is very hacky and unelegant. It it mainly in there since we did have the Boost dependency and I did not want to bother implementing a varaidic/any from scratch.

Agreed, this should be replaced to get rid of even more dependence on Boost in the future.

@C0nsultant C0nsultant changed the title Boost: Variadic (& MPL) Boost: Variadic (& MPL), filesystem Feb 16, 2018
@ax3l ax3l mentioned this issue Feb 16, 2018
@ax3l ax3l changed the title Boost: Variadic (& MPL), filesystem Remove Boost Dependency Feb 16, 2018
@ax3l
Copy link
Member Author

ax3l commented Apr 19, 2018

The last thing that is left is boost::filesystem (boost/filesystem.hpp).

The functionality we need from it is (@C0nsultant pls append if I missed something):

  • path (object)
  • exists (dir, file)
  • directory_iterator
  • create_directories
  • remove (file)

(all of this: Linux/Unix, OSX, Windows)

@C0nsultant
Copy link
Member

That should be it. To put it in terms less specific to Boost:

  • directory existence check
  • directory creation
  • directory content listing
  • file existence check
  • file deletion

@ax3l
Copy link
Member Author

ax3l commented May 24, 2018

I think we can put this in a single auxiliary/ header + source file. @C0nsultant do you want to try implementing the 5 methods? I think it's not worth pulling a dependency and we can just take what we need.

@C0nsultant
Copy link
Member

We could potentially build a very slim backport of std::filesystem that offers the few functions we need. Then we can drop-in std::filesystem the same way as variant if the library is being built with C++17.

As a sidenote, this also means we have to assume POSIX availability for non-Windows systems.

@ax3l
Copy link
Member Author

ax3l commented May 24, 2018

I thought so first as well, but alone the implementation of path objects, etc. is probably not worth it outside of pure curiosity. Since we don't need anything recursive I think the 5 slim functions above will be enough.

@C0nsultant
Copy link
Member

C0nsultant commented May 24, 2018

It's on my list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants