-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add common_iterator * Update variant.hpp * init common_view * Update variant.hpp * Add LOGXD * Create memory.hpp * Update logger.hpp * Fix common_iterator * Fix common_iterator * Update common_iterator.hpp * Add ranges::common_view, views::common * Add ranges::rbegin * Update rbegin * Update rbegin.hpp * Update rbegin.hpp * Add is_class_or_enum * Update not_incomplete_array.hpp * Add ranges::rend * Add ranges::reverse_view * Update reverse_view.hpp * Add is_subrange * Add views::reverse * Update ranges_test.cpp * Update ranges_test.cpp * Add ranges::join_with_view, views::join_with * Fix error * Update join_with_view.hpp * Add concat_view * Add concat_view * Update concat_view.hpp * Update concat_view.hpp * Update ranges_test.cpp * Update ranges_test.cpp * Fix views::split * Update concepts.hpp * Update concat_view.hpp * Update non_propagating_cache.hpp * Add drop_while_view, drop_while * Update drop_while_view.hpp * Update concat * Add tuple algorithm * Update concat_view.hpp * Update concat_view.hpp * Fix common_reference * Fix common_type * Move maybe_const * Update tuple_like.hpp * Add key, value * Add ranges:: lexicographical_compare * Fix hard error of indirectly_readable * Update basic_const_iterator.hpp * Support ranges for type_support * Fix unnecessary forwarding
- Loading branch information
Showing
70 changed files
with
3,732 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
include/type_support/include/vccc/__type_support/detail/container_at.hpp
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
include/type_support/include/vccc/__type_support/detail/range_at.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# /* | ||
# * Created by YongGyu Lee on 2020/12/08. | ||
# */ | ||
# | ||
# ifndef VCCC_TYPE_SUPPORT_DETAIL_RANGE_AT_HPP | ||
# define VCCC_TYPE_SUPPORT_DETAIL_RANGE_AT_HPP | ||
# | ||
# include <type_traits> | ||
# include <utility> | ||
# | ||
# include "vccc/ranges.hpp" | ||
# include "vccc/utility.hpp" | ||
|
||
namespace vccc { | ||
|
||
/** | ||
@addtogroup type_support_at__func | ||
@{ | ||
@defgroup type_support_at_container__func vccc::at (container) | ||
Index-based value accessor | ||
@{ | ||
*/ | ||
template<std::size_t i, typename R, std::enable_if_t<ranges::range<R>::value, int> = 0> | ||
decltype(auto) | ||
at(R&& container) | ||
{ | ||
BOUNDS_ASSERT(i, ranges::distance(container)); | ||
return *ranges::next(ranges::begin(container), i); | ||
} | ||
|
||
//! @} | ||
//! @} type_support | ||
|
||
} | ||
|
||
# endif // VCCC_TYPE_SUPPORT_DETAIL_RANGE_AT_HPP |
87 changes: 87 additions & 0 deletions
87
include/vccc/__algorithm/ranges/lexicographical_compare.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// Created by YongGyu Lee on 2/24/24. | ||
// | ||
|
||
#ifndef VCCC_ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_HPP | ||
#define VCCC_ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_HPP | ||
|
||
#include <functional> | ||
#include <type_traits> | ||
|
||
#include "vccc/__core/inline_or_static.hpp" | ||
#include "vccc/__functional/identity.hpp" | ||
#include "vccc/__functional/invoke.hpp" | ||
#include "vccc/__functional/less.hpp" | ||
#include "vccc/__iterator/indirect_strict_weak_order.hpp" | ||
#include "vccc/__iterator/input_iterator.hpp" | ||
#include "vccc/__iterator/projected.hpp" | ||
#include "vccc/__iterator/sentinel_for.hpp" | ||
#include "vccc/__ranges/begin.hpp" | ||
#include "vccc/__ranges/end.hpp" | ||
#include "vccc/__utility/cxx20_rel_ops.hpp" | ||
|
||
namespace vccc { | ||
namespace ranges { | ||
namespace detail { | ||
|
||
struct lexicographical_compare_niebloid { | ||
private: | ||
template<typename I1, typename Proj1, typename I2, typename Proj2, typename Comp, | ||
bool = conjunction<projectable<I1, Proj1>, projectable<I2, Proj2>>::value /* false_type */> | ||
struct test_projectable_iterator : std::false_type {}; | ||
template<typename I1, typename Proj1, typename I2, typename Proj2, typename Comp> | ||
struct test_projectable_iterator<I1, Proj1, I2, Proj2, Comp, true> | ||
: indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>> {}; | ||
|
||
template<typename R1, typename Proj1, typename R2, typename Proj2, typename Comp, | ||
bool = conjunction<input_range<R1>, input_range<R2>>::value /* false_type */> | ||
struct test_projectable_range : std::false_type {}; | ||
template<typename R1, typename Proj1, typename R2, typename Proj2, typename Comp> | ||
struct test_projectable_range<R1, Proj1, R2, Proj2, Comp, true> | ||
: test_projectable_iterator<iterator_t<R1>, Proj1, iterator_t<R2>, Proj2, Comp> {}; | ||
|
||
public: | ||
template< | ||
typename I1, typename S1, | ||
typename I2, typename S2, | ||
typename Proj1 = identity, typename Proj2 = identity, typename Comp = ranges::less, | ||
std::enable_if_t<conjunction< | ||
input_iterator<I1>, sentinel_for<S1, I1>, | ||
input_iterator<I2>, sentinel_for<S2, I2>, | ||
test_projectable_iterator<I1, Proj1, I2, Proj2, Comp> | ||
>::value, int> = 0 | ||
> | ||
constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const { | ||
using namespace rel_ops; | ||
for (; (first1 != last1) && (first2 != last2); ++first1, (void) ++first2) { | ||
if (vccc::invoke(comp, vccc::invoke(proj1, *first1), vccc::invoke(proj2, *first2))) | ||
return true; | ||
if (vccc::invoke(comp, vccc::invoke(proj2, *first2), vccc::invoke(proj1, *first1))) | ||
return false; | ||
} | ||
return (first1 == last1) && (first2 != last2); | ||
} | ||
|
||
template<typename R1, typename R2, typename Proj1 = identity, typename Proj2 = identity, typename Comp = less, std::enable_if_t< | ||
test_projectable_range<R1, Proj1, R2, Proj2, Comp> | ||
::value, int> = 0> | ||
constexpr bool operator()(R1&& r1, R2&& r2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const { | ||
return (*this)(ranges::begin(r1), ranges::end(r1), ranges::begin(r2), ranges::end(r2), std::ref(comp), std::ref(proj1), std::ref(proj2)); | ||
} | ||
|
||
}; | ||
|
||
} // namespace detail | ||
|
||
/// @addtogroup algorithm | ||
/// @{ | ||
|
||
/// @brief returns `true` if one range is lexicographically less than another | ||
VCCC_INLINE_OR_STATIC constexpr detail::lexicographical_compare_niebloid lexicographical_compare{}; | ||
|
||
/// @} | ||
|
||
} // namespace ranges | ||
} // namespace vccc | ||
|
||
#endif // VCCC_ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.