Skip to content

Commit

Permalink
Force failure for begin/end on volatile initializer_list
Browse files Browse the repository at this point in the history
Fixes #126.
  • Loading branch information
CaseyCarter committed May 13, 2018
1 parent 916fb88 commit 2ea3202
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/range/v3/begin_end.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ namespace ranges
template<typename T>
void begin(T const &) = delete;

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8
// Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85765
template<typename T>
void begin(std::initializer_list<T> volatile &) = delete;
template<typename T>
void begin(std::initializer_list<T> const volatile &) = delete;
#endif

struct fn
{
private:
Expand Down Expand Up @@ -120,6 +128,14 @@ namespace ranges
template<typename T>
void end(T const &) = delete;

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8
// Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85765
template<typename T>
void end(std::initializer_list<T> volatile &) = delete;
template<typename T>
void end(std::initializer_list<T> const volatile &) = delete;
#endif

struct fn
{
private:
Expand Down

0 comments on commit 2ea3202

Please sign in to comment.