forked from Alepha/Alepha
Apply the newer namespace rules and layout/formatting.
This commit is contained in:
43
Meta/find.h
43
Meta/find.h
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user