Skip to content

Commit

Permalink
Containers: fix StridedArrayView with std::unique() on MSVC 2015.
Browse files Browse the repository at this point in the history
Ah well.
  • Loading branch information
mosra committed May 11, 2022
1 parent a99f675 commit ba75f71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Corrade/Containers/StridedArrayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,13 @@ template<unsigned dimensions, class T> class StridedIterator {

#ifndef DOXYGEN_GENERATING_OUTPUT
/*implicit*/ StridedIterator(typename std::conditional<std::is_const<T>::value, const void, void>::type* data, const StridedDimensions<dimensions, std::size_t>& size, const StridedDimensions<dimensions, std::ptrdiff_t>& stride, std::size_t i) noexcept: _data{data}, _size{size}, _stride{stride}, _i{i} {}

#ifdef CORRADE_MSVC2015_COMPATIBILITY
/* Needed by MSVC 2015 to make StridedIterator usable with
std::unique() -- it wants to default-construct it, for some reason.
See StridedArrayViewStlTest::unique() for a repro case. */
/*implicit*/ StridedIterator(): _data{}, _size{}, _stride{}, _i{} {}
#endif
#endif

/** @brief Equality comparison */
Expand Down

0 comments on commit ba75f71

Please sign in to comment.