boostorg / bind

Boost.org bind module
http://boost.org/libs/bind
27 stars 49 forks source link

Use `is_same` from Boost.TypeTraits #31

Closed Lastique closed 1 year ago

Lastique commented 1 year ago

boost::core::is_same is deprecated, so use the one from Boost.TypeTraits.

Note: This introduces a dependency on Boost.TypeTraits. I figured, this is better than duplicating is_same or depending on boost::core::detail::is_same. Boost.TypeTraits is a fairly lightweight nowdays. If you prefer a different solution, let me know.

pdimov commented 1 year ago

Since Bind only depends on Core, and since people tend to dislike new dependencies in core libraries, it's probably better to use core::detail::is_same here (or a local copy).

Lastique commented 1 year ago

Ok, done. Note however, if we're going to phase away enable_if from Boost.Core in favor of Boost.TypeTraits, we will have this problem again, and enable_if is not quite as simple to duplicate.

pdimov commented 1 year ago

It's actually pretty easy. https://github.com/boostorg/type_traits/blob/develop/include/boost/type_traits/enable_if.hpp

Core's enable_if has a different interface from the standard/type_traits one, though, so I doubt we'll be able to phase it out.