Closed pfultz2 closed 10 years ago
I would be willing to merge this if it had a test case, like:
constexpr bool b = boost::is_integral
Alright, I added test cases.
I pushed this after rebasing it, so I'll close. Thanks for the tests.
Has this been merged to master?
I just sent a fix that should have been already fixed in this patch (see #7).
@robertramey replied on Mar 27
Why is this change necessary? Integral constants don't need to be constant expressions - const (which they already are) is enough. [...]
Integral constants are intended to be used for compile-time computations. Unless they provide a constexpr
interface they can't be used within constexpr
functions in C++11/14.
I don't see what this change would fix or improve - and it's very hard to anticipate possible surprises.
This allows you to, e.g., fold
over a boost::mpl::range_c
range inside a constexpr function like this:
fold(boost::mpl::range_c<int, 0, 10>{}, 0, my_constexpr_computation_object{});
Unfortunately, one cannot use lambdas within constexpr functions yet, so it feels a bit C++03.
@gnzlbg It has been merged into develop, but not into master yet.
Also, I believe pull requests should be off of develop, not master branch. (see here) I'm not sure why, it shouldn't matter, but it seems like boost is still new to the git branching model.
@pfultz2 thanks I didn't saw it.
When I update my local git I only update master branches..
If something is unfinished it should be in develop, but this pull-request seems pretty finished, so I don't see the point into merging it on develop and not on master.. I could have benefitted from it a lot today morning.
The general idea is to fix things on develop, let the tests cycle, then merge to master.
@mclow marshall do you know if there is a way to check out the develop branches for every library in modular-boost instead of the master branches?
I believe that git submodule foreach git checkout develop
should do it.
@mclow thanks marshall, works like charm.
I added constexpr to conversion operator for integral constants, this will make type traits more closely match the type traits in C++14.