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

with_braced_init_args is failing on older gcc versions #755

Closed
ericniebler opened this issue Nov 29, 2017 · 3 comments
Closed

with_braced_init_args is failing on older gcc versions #755

ericniebler opened this issue Nov 29, 2017 · 3 comments
Labels

Comments

@ericniebler
Copy link
Owner

The following code fails to compile with versions of gcc before the 7.x series.

#include <range/v3/core.hpp>
#include <range/v3/algorithm/count.hpp>

int main() {
    return ranges::count({true,false,true,false}, true);
}

The error message is:

prog.cc: In function 'int main()':
prog.cc:5:55: error: call of '(const ranges::v3::with_braced_init_args<ranges::v3::with_braced_init_args<ranges::v3::count_fn> >) (<brace-enclosed initializer list>, bool)' is ambiguous
     return ranges::count({true,false,true,false}, true);
                                                       ^
In file included from /opt/wandbox/range-v3/include/range/v3/utility/iterator_concepts.hpp:23:0,
                 from /opt/wandbox/range-v3/include/range/v3/begin_end.hpp:25,
                 from /opt/wandbox/range-v3/include/range/v3/core.hpp:17,
                 from prog.cc:1:
/opt/wandbox/range-v3/include/range/v3/utility/functional.hpp:889:18: note: candidate: constexpr decltype (declval<const ImplFn&>()(std::move(rng0), (declval<Args>)()...)) ranges::v3::with_braced_init_args<ImplFn>::operator()(std::initializer_list<V0>&&, Args&& ...) const [with V0 = bool; Args = {bool}; ImplFn = ranges::v3::with_braced_init_args<ranges::v3::count_fn>; decltype (declval<const ImplFn&>()(std::move(rng0), (declval<Args>)()...)) = long int]
             auto operator()(std::initializer_list<V0> &&rng0, Args &&...args) const ->
                  ^~~~~~~~
/opt/wandbox/range-v3/include/range/v3/utility/functional.hpp:889:18: note: candidate: constexpr decltype (declval<const ImplFn&>()(std::move(rng0), (declval<Args>)()...)) ranges::v3::with_braced_init_args<ImplFn>::operator()(std::initializer_list<V0>&&, Args&& ...) const [with V0 = bool; Args = {bool}; ImplFn = ranges::v3::count_fn; decltype (declval<const ImplFn&>()(std::move(rng0), (declval<Args>)()...)) = long int]
@ericniebler ericniebler changed the title with_braced_init is failing on older gcc versions with_braced_init_args is failing on older gcc versions Nov 29, 2017
@ericniebler
Copy link
Owner Author

Meta question: do we even care about calling the algorithms with braced init lists? The Ranges TS doesn't bother with handling these.

@CaseyCarter
Copy link
Collaborator

If you aren't motivated enough to specify this feature - I know I'm not - then it's probably not useful enough to keep around. Drop in 0.4?

@ericniebler
Copy link
Owner Author

None of the algorithms in the v1.0-beta branch use with_braced_init_args, so closing as fixed.

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

No branches or pull requests

2 participants