1
0
forked from Alepha/Alepha

Apply the newer namespace rules and layout/formatting.

This commit is contained in:
2024-04-02 23:32:02 -04:00
parent 53a4d91a23
commit 373b07e1c4
31 changed files with 501 additions and 536 deletions

View File

@ -9,36 +9,31 @@ static_assert( __cplusplus > 2020'99 );
#include <Alepha/Meta/Container/vector.h>
#include <Alepha/Meta/functional.h>
namespace Alepha::Hydrogen::Meta
namespace Alepha::Hydrogen::Meta ::detail:: find_algo_m
{
inline namespace exports { inline namespace find_algos {} }
namespace detail::find_algos
inline namespace exports
{
inline namespace exports
template< typename Iter, typename Predicate >
constexpr bool
find_if( const Iter first, const Iter last, Predicate pred )
{
template< typename Iter, typename Predicate >
constexpr bool
find_if( const Iter first, const Iter last, Predicate pred )
for( Iter pos= first; pos != last; ++pos )
{
for( Iter pos= first; pos != last; ++pos )
{
if( pred( *pos ) ) return true;
}
return false;
if( pred( *pos ) ) return true;
}
return false;
}
template< typename Iter, typename Value >
constexpr bool
find( const Iter first, const Iter last, const Value value )
{
return find_if( first, last, Meta::bind1st( std::equal_to{}, value ) );
}
template< typename Iter, typename Value >
constexpr bool
find( const Iter first, const Iter last, const Value value )
{
return find_if( first, last, Meta::bind1st( std::equal_to{}, value ) );
}
}
namespace exports::find_algos
{
using namespace detail::find_algos::exports;
}
}
namespace Alepha::Hydrogen::Meta::inline exports::inline find_algo_m
{
using namespace detail::find_algo_m::exports;
}