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

@ -13,7 +13,7 @@ static_assert( __cplusplus > 2020'99 );
namespace
{
using namespace Alepha::Utility::exports::evaluation_helpers;
using namespace Alepha::Utility::exports::evaluation_helpers_m;
using namespace Alepha::Testing::literals;
using std::begin, std::end;

View File

@ -4,21 +4,16 @@ static_assert( __cplusplus > 2020'99 );
#include <Alepha/Alepha.h>
namespace Alepha::Hydrogen::Meta
namespace Alepha::Hydrogen::Meta ::detail:: dep_value_m
{
inline namespace exports { inline namespace dependent_value {} }
namespace detail::dependent_value
inline namespace exports
{
inline namespace exports
{
template< auto value, typename T >
constexpr auto dep_value= value;
}
}
namespace exports::dependent_value
{
using namespace detail::dependent_value::exports;
template< auto value, typename T >
constexpr auto dep_value= value;
}
}
namespace Alepha::Hydrogen::Meta::inline exports::inline dep_value_m
{
using namespace detail::dep_value_m::exports;
}

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;
}

View File

@ -6,51 +6,46 @@ static_assert( __cplusplus > 2020'99 );
#include <Alepha/Alepha.h>
namespace Alepha::Hydrogen::Meta
namespace Alepha::Hydrogen::Meta ::detail:: functional_m
{
inline namespace exports { inline namespace functional {} }
namespace detail::functional
inline namespace exports
{
inline namespace exports
{
template< typename MetaFunction, typename Arg >
constexpr auto bind1st( MetaFunction func, Arg arg );
}
template< typename MetaFunction, typename Arg > struct binder1st;
template< typename MetaFunction, typename Arg1, typename Arg2 >
constexpr decltype( auto )
invoke_call( MetaFunction func, Meta::type_value< Arg1 > arg1, Meta::type_value< Arg2 > arg2 )
{
return func( arg1, arg2 );
}
template< typename MetaFunction, typename Arg >
struct binder1st< MetaFunction, Meta::type_value< Arg > >
{
MetaFunction func;
Meta::type_value< Arg > arg;
template< typename Second >
constexpr decltype( auto )
operator () ( const Second &second )
{
return invoke_call( func, arg, second );
}
};
template< typename MetaFunction, typename Arg >
constexpr auto
exports::bind1st( MetaFunction func, Arg arg )
{
return binder1st< MetaFunction, Arg >{ func, arg };
}
constexpr auto bind1st( MetaFunction func, Arg arg );
}
namespace exports::functional
template< typename MetaFunction, typename Arg > struct binder1st;
template< typename MetaFunction, typename Arg1, typename Arg2 >
constexpr decltype( auto )
invoke_call( MetaFunction func, Meta::type_value< Arg1 > arg1, Meta::type_value< Arg2 > arg2 )
{
using namespace detail::functional::exports;
return func( arg1, arg2 );
}
template< typename MetaFunction, typename Arg >
struct binder1st< MetaFunction, Meta::type_value< Arg > >
{
MetaFunction func;
Meta::type_value< Arg > arg;
template< typename Second >
constexpr decltype( auto )
operator () ( const Second &second )
{
return invoke_call( func, arg, second );
}
};
template< typename MetaFunction, typename Arg >
constexpr auto
exports::bind1st( MetaFunction func, Arg arg )
{
return binder1st< MetaFunction, Arg >{ func, arg };
}
}
namespace Alepha::Hydrogen::Meta::inline exports::inline functional_m
{
using namespace detail::functional_m::exports;
}