-
Notifications
You must be signed in to change notification settings - Fork 165
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
WIP: Use return type deduction to support lambda function #227
Conversation
#define GIL_GENERATE_APPLY_FWD_OPS(N) BOOST_PP_REPEAT(N, GIL_APPLY_FWD_OP, BOOST_PP_EMPTY) | ||
|
||
namespace detail { | ||
template <std::size_t N> struct apply_operation_fwd_fn {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not increases the indentation level within namespace.
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md#guidelines
|
||
// unary application | ||
template <typename Types, typename Bits, typename Op> | ||
auto BOOST_FORCEINLINE apply_operation_basec(const Bits& bits, std::size_t index, Op op) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we try to keep the lines shorter, this way?
BOOST_FORCEINLINE
auto apply_operation_basec(const Bits& bits, std::size_t index, Op op)
{
...
}
(@sdebionne I've just updated the snippet above)
BTW, there have been some discussion about possibility to get rid of BOOST_FORCEINLINE
one day.
} | ||
|
||
namespace detail { | ||
template <typename T2, typename Op> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not increases the indentation level within namespace.
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md#guidelines
|
||
// Binary application by applying on each dimension separately | ||
template <typename Types1, typename Types2, typename Bits1, typename Bits2, typename Op> | ||
static auto BOOST_FORCEINLINE apply_operation_base(const Bits1& bits1, std::size_t index1, const Bits2& bits2, std::size_t index2, Op op) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write your code to fit within 90 columns of text
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md#guidelines
#else | ||
|
||
#define GIL_APPLY_FWD_OP(z, N, text) \ | ||
template <> struct apply_operation_fwd_fn<BOOST_PP_ADD(N,1)> { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I once had a wish to get rid of BOOST_PP_*
:)
} \ | ||
template <typename Types, typename Bits, typename UnaryOp> \ | ||
auto applyc(const Bits& bits, std::size_t index, UnaryOp op) const { \ | ||
typedef typename mpl::begin<Types>::type \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to replace all the MPL stuff with MP11 (http://boost.org/libs/mp11/) ?
This is a new code and it would help if it does not introduce any more uses of MPL which I'm trying to get rid of.
Even if MP11requires a bit of temporary plumbing e.g. to map boost::{true|false}_
to std::{true|false}_type
, I think it is worth to try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try but this is not really new code, it's mostly copy-and-paste and getting rid of the explicit return type, letting C++14 return type deduction do the work when available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I mean, it's worth a try, but I don't think it's a show-stopper, if you don't.
I'll fix the formatting issues (actually I think I have a less redondant solution) but I have a question regarding the CI: are there any tests that run with std=C++14? My modifications are only active when |
No, we currently don't have any builds for C++14 mode. I think it would be a good idea to add one, and for C++17 too.
Let me know and I will add new build job, then you can update your PR. |
Superseded by #231.
Nope, whatever is easier for you.
According to compiler support, anything above gcc 5 is fully c++14 compliant. Personally I use gcc 7.3 as it's the one that ship with Conda but that is not a requirement. Azure pipelines look nice and reactive. |
OK, I will try to work it out today. |
Allows to use gil variant (e.g.
any_image<>
) visitation with generic lambdas:Tasklist