Coder Social home page Coder Social logo

Comments (5)

stefanseefeld avatar stefanseefeld commented on August 18, 2024 1

I expect that with the above approach you would end up with lots of locations in the code that would use such a conditional logic, which IMO makes the code hard to read.

Thus what I'd propose is something like:

namespace boost { namespace python { namespace detail {
#if __cplusplus < 201103L
  using boost::remove_cv;
  ...
#else
  using std::remove_cv;
  ..
}}} // namespace boost::python::detail

such that in the rest of Boost.Python's code you could then simply refer to boost::python::detail::remove_cv etc., not having to care which original definition this aliases.
(Note, however, that this is just an idea that I would try out. I haven't actually tested this, and thus could be convinced that it isn't workable. I'd put the conditional above into a new header boost/python/detail/type_traits.hpp...)

from python.

shreyans800755 avatar shreyans800755 commented on August 18, 2024

@stefanseefeld @dabrahams
I would like to work on this issue.

Just to confirm and get along with contributing method, I need to create PR against develop branch, right ?
EDIT: Is there anybody else working on this issue ? If so, I can pick up something else.

from python.

stefanseefeld avatar stefanseefeld commented on August 18, 2024

@shreyans800755 , great ! I'm not aware of anyone else working on this right now, so this would be a great contribution. Please be sure to conditionalize these substitutions to only be active whenever a compiler with the appropriate language support is used. We need to maintain backward compatibility.

I suggest a new boost/python/detail/type_traits.hpp header for this.

PRs need to be created against the develop branch.

from python.

shreyans800755 avatar shreyans800755 commented on August 18, 2024

@stefanseefeld
I'm trying to apply the patch like following:
Adding

#if __cplusplus < 201103L
          typename boost::remove_cv<T>::type
#else
          typename std::remove_cv<T>::type
#endif

and removing
typename boost::remove_cv<T>::type

I don't understand why we need a new file boost/python/detail/type_traits.hpp. Can you please explain ? Am I missing something ?

from python.

shreyans800755 avatar shreyans800755 commented on August 18, 2024

That's wonderful idea. I knew, changes were a bit cumbersome. This sounds like an elegant solution. I'll try to move ahead with this.

from python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.