Skip to content

Commit

Permalink
finor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
n0lavar committed Jun 9, 2023
1 parent eacef5c commit bf3a0d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/qx/algo/contains.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool contains(fwd_it_t itBegin, fwd_it_t itEnd, const T& value)
@retval - true if container contains value
**/
template<class container_t, class T>
bool contains(container_t& container, const T& value)
bool contains(const container_t& container, const T& value)
{
return contains(container.begin(), container.end(), value);
}
Expand Down Expand Up @@ -68,7 +68,7 @@ bool contains_if(fwd_it_t itBegin, fwd_it_t itEnd, const predicate_t& predicate)
@retval - true if at least one of container elements satisfies predicate
**/
template<class container_t, class predicate_t>
bool contains_if(container_t& container, const predicate_t& predicate)
bool contains_if(const container_t& container, const predicate_t& predicate)
{
return contains_if(container.begin(), container.end(), predicate);
}
Expand Down
5 changes: 3 additions & 2 deletions include/qx/meta/concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#pragma once

#include <type_traits>
#include <utility>

namespace qx
{
Expand All @@ -27,8 +28,8 @@ template<class T>
concept is_random_access_iterator =
is_iterator<T> && std::derived_from<typename T::iterator_category, std::random_access_iterator_tag>;

template<class T, class return_t = void, class... args_t>
concept callable = requires(T t, args_t&&... args) {
template<class T, class return_t, class... args_t>
concept callable_c = requires(T t, args_t&&... args) {
{
t(std::forward<args_t>(args)...)
} -> std::convertible_to<return_t>;
Expand Down
2 changes: 1 addition & 1 deletion include/qx/patterns/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class base_return_object_iterator : public base_iterator_t
using iterator_category = std::contiguous_iterator_tag;
using iterator_concept = std::contiguous_iterator_tag;

using base_iterator_t::BaseIterator;
using base_iterator_t::base_iterator_t;

[[nodiscard]] constexpr value_type operator*() const noexcept
{
Expand Down
4 changes: 2 additions & 2 deletions include/qx/recursive_lambda.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ struct recursive_lambda
/**
@brief Create lambda that can be called recursively
@tparam lambda_t - lambda type: see code example
@param lambda - lambda object
@retval - lambda that can be called recursively
@param lambda - lambda object
@retval - lambda that can be called recursively
@code
auto calc_fibonacci = qx::make_recursive_lambda(
Expand Down

0 comments on commit bf3a0d9

Please sign in to comment.