Skip to content

Commit

Permalink
✨ Range version of algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Jan 8, 2024
1 parent ea272b4 commit 3efae9e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
9 changes: 9 additions & 0 deletions include/ztd/ranges/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,15 @@ namespace ztd { namespace ranges {
_OutRange(::std::move(__out_first), ::std::move(__out_last)) };
}

template <typename _Input, typename _Output>
constexpr auto __copy(_Input&& __input, _Output&& __output) noexcept(
__copy_noexcept<ztd::ranges::range_const_iterator_t<_Input>, ztd::ranges::range_const_sentinel_t<_Input>,
ztd::ranges::range_iterator_t<_Output>, ztd::ranges::range_sentinel_t<_Output>>()) {
return ::ztd::ranges::__rng_detail::__copy(::ztd::ranges::cbegin(std::forward<_Input>(__input)),
::ztd::ranges::cend(__input), ::ztd::ranges::begin(std::forward<_Output>(__output)),
::ztd::ranges::end(__output));
}

template <typename _First0, typename _Last0, typename _First1, typename _Last1>
constexpr int __lexicographical_compare_three_way_basic(
_First0 __first0, _Last0 __last0, _First1 __first1, _Last1 __last1) {
Expand Down
22 changes: 21 additions & 1 deletion include/ztd/version/detail/version.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@
#define ZTD_COMPILER_MINGW_I_ ZTD_OFF
#endif

#if defined (ZTD_CXX_VERSION)
#define ZTD_CXX_VERSION_I_ ZTD_CXX_VERSION
#elif ZTD_IS_ON(ZTD_CXX)
#if ZTD_IS_ON(ZTD_COMPILER_VCXX) && defined(_MSVC_LANG)
#define ZTD_CXX_VERSION_I_ _MSVC_LANG
#else
#define ZTD_CXX_VERSION_I_ __cplusplus
#endif
#else
#define ZTD_CXX_VERSION_I_ 0
#endif

#if defined (ZTD_C_VERSION)
#define ZTD_C_VERSION_I_ ZTD_C_VERSION
#elif ZTD_IS_ON(ZTD_C)
#define ZTD_CXX_VERSION_I_ __STDC_VERSION__
#else
#define ZTD_C_VERSION_I_ 0
#endif

#if defined(__GLIBCXX__)
#define ZTD_LIBSTDCXX_I_ ZTD_ON
#else
Expand Down Expand Up @@ -706,7 +726,7 @@

#if (ZTD_HAS_ATTRIBUTE_I_(no_unique_address) != 0L)
#define ZTD_NO_UNIQUE_ADDRESS_I_ [[no_unique_address]]
#elif ZTD_IS_ON(ZTD_CXX) && ZTD_IS_ON(ZTD_COMPILER_VCXX) && _MSC_VER >= 1929L
#elif ZTD_IS_ON(ZTD_CXX) && ZTD_IS_ON(ZTD_COMPILER_VCXX) && _MSC_VER >= 1929L && ZTD_USE(ZTD_CXX_VERSION) >= 202000L
#define ZTD_NO_UNIQUE_ADDRESS_I_ [[msvc::no_unique_address]]
#else
#define ZTD_NO_UNIQUE_ADDRESS_I_
Expand Down

0 comments on commit 3efae9e

Please sign in to comment.