Skip to content

Commit

Permalink
Merge pull request ericniebler#1273 from CaseyCarter/meta_fix
Browse files Browse the repository at this point in the history
Rename meta::detail::bool_ to avoid inadvertent use
  • Loading branch information
CaseyCarter authored Aug 22, 2019
2 parents d911614 + 6201b33 commit 9cc9afd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/meta/meta_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#if __cpp_concepts <= 201507L
#define META_CONCEPT concept bool
// TS concepts subsumption barrier for atomic expressions
#define META_CONCEPT_BARRIER(...) ::meta::detail::bool_<__VA_ARGS__>
#define META_CONCEPT_BARRIER(...) ::meta::detail::barrier<__VA_ARGS__>
#else
#define META_CONCEPT concept
#define META_CONCEPT_BARRIER(...) __VA_ARGS__
Expand Down Expand Up @@ -267,7 +267,7 @@ namespace meta
namespace detail
{
template <bool B>
META_INLINE_VAR constexpr bool bool_ = B;
META_INLINE_VAR constexpr bool barrier = B;

template <class T, T> struct require_constant; // not defined
}
Expand Down
4 changes: 4 additions & 0 deletions include/range/v3/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ namespace ranges
#define RANGES_DIAGNOSTIC_IGNORE_DIVIDE_BY_ZERO RANGES_DIAGNOSTIC_IGNORE(4723 4724)
#define RANGES_DIAGNOSTIC_IGNORE_UNSIGNED_MATH RANGES_DIAGNOSTIC_IGNORE(4146)
#define RANGES_DIAGNOSTIC_IGNORE_TRUNCATION RANGES_DIAGNOSTIC_IGNORE(4244)
#define RANGES_DIAGNOSTIC_IGNORE_MULTIPLE_ASSIGNMENT_OPERATORS \
RANGES_DIAGNOSTIC_IGNORE(4522)

#define RANGES_CXX_VER _MSVC_LANG

Expand Down Expand Up @@ -309,6 +311,7 @@ namespace ranges
#define RANGES_DIAGNOSTIC_IGNORE_DIVIDE_BY_ZERO
#define RANGES_DIAGNOSTIC_IGNORE_UNSIGNED_MATH
#define RANGES_DIAGNOSTIC_IGNORE_TRUNCATION
#define RANGES_DIAGNOSTIC_IGNORE_MULTIPLE_ASSIGNMENT_OPERATORS

#define RANGES_WORKAROUND_CWG_1554
#ifdef __clang__
Expand Down Expand Up @@ -349,6 +352,7 @@ namespace ranges
#define RANGES_DIAGNOSTIC_IGNORE_DIVIDE_BY_ZERO
#define RANGES_DIAGNOSTIC_IGNORE_UNSIGNED_MATH
#define RANGES_DIAGNOSTIC_IGNORE_TRUNCATION
#define RANGES_DIAGNOSTIC_IGNORE_MULTIPLE_ASSIGNMENT_OPERATORS
#endif

// Configuration via feature-test macros, with fallback to __cplusplus
Expand Down
5 changes: 5 additions & 0 deletions include/range/v3/iterator/basic_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#include <range/v3/utility/semiregular_box.hpp>
#include <range/v3/utility/static_const.hpp>

RANGES_DIAGNOSTIC_PUSH
RANGES_DIAGNOSTIC_IGNORE_MULTIPLE_ASSIGNMENT_OPERATORS

namespace ranges
{
/// \addtogroup group-iterator Iterator
Expand Down Expand Up @@ -935,4 +938,6 @@ namespace std
} // namespace std
/// \endcond

RANGES_DIAGNOSTIC_POP

#endif
10 changes: 5 additions & 5 deletions test/experimental/utility/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ struct coro_fn

CPP_template(typename V)(
requires ranges::input_range<V> && ranges::view_<V> &&
is_copy_constructible_or_ref<ranges::range_reference_t<V>>())
(is_copy_constructible_or_ref<ranges::range_reference_t<V>>()))
static generator_for<V> impl(V v)
{
if /* constexpr */ (ranges::sized_range<V>)
if(RANGES_CONSTEXPR_IF(ranges::sized_range<V>))
co_await static_cast<ranges::experimental::generator_size>((std::size_t)ranges::distance(v));
auto first = ranges::begin(v);
auto const last = ranges::end(v);
Expand Down Expand Up @@ -126,9 +126,9 @@ ranges::experimental::generator<T> iota_generator(T t)
}

CPP_template(class T, class S)(
requires ranges::weakly_incrementable<T> &&
requires (ranges::weakly_incrementable<T> &&
ranges::detail::weakly_equality_comparable_with_<T, S> &&
(!ranges::sized_sentinel_for<S, T>) && !(ranges::integral<T> && ranges::integral<S>))
!ranges::sized_sentinel_for<S, T> && !(ranges::integral<T> && ranges::integral<S>)))
ranges::experimental::generator<T> iota_generator(T t, S const s)
{
for (; t != s; ++t)
Expand Down Expand Up @@ -165,7 +165,7 @@ meta::invoke<
ranges::indirect_result_t<F &, ranges::iterator_t<V>>>
transform(V view, F f)
{
if /* constexpr */ (ranges::sized_range<V>)
if(RANGES_CONSTEXPR_IF(ranges::sized_range<V>))
co_await static_cast<ranges::experimental::generator_size>((std::size_t) ranges::distance(view));
RANGES_FOR(auto &&i, view)
co_yield ranges::invoke(f, i);
Expand Down

0 comments on commit 9cc9afd

Please sign in to comment.