Skip to content

Commit 16c9ac9

Browse files
authored
Merge pull request #540 from beached/v2
Removed DAW_FWD2 and fixed mismatch of struct/class
2 parents a397fc1 + 8d799eb commit 16c9ac9

91 files changed

Lines changed: 3315 additions & 1902 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
cmake_minimum_required( VERSION 3.14 )
1010

1111
project( "daw-header-libraries"
12-
VERSION "2.118.0"
12+
VERSION "2.123.0"
1313
DESCRIPTION "Various headers"
1414
HOMEPAGE_URL "https://github.com/beached/header_libraries"
1515
LANGUAGES C CXX
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright (c) Darrell Wright
2+
//
3+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
4+
// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
5+
//
6+
// Official repository: https://github.com/beached/header_libraries
7+
//
8+
9+
#pragma once
10+
11+
#include "daw/daw_attributes.h"
12+
#include "daw/daw_ordering_to_integer.h"
13+
#include "daw/daw_traits.h"
14+
#include "daw/traits/daw_remove_array_ref.h"
15+
16+
#include <functional>
17+
#include <type_traits>
18+
19+
namespace daw {
20+
namespace array_cmp_details {
21+
#if defined( DAW_HAS_CPP20_3WAY )
22+
template<typename Order>
23+
inline constexpr Order equal_or_equivalent_v =
24+
daw::equal_or_equivalent_v<Order>;
25+
#else
26+
template<typename>
27+
inline constexpr bool equal_or_equivalent_v = true;
28+
#endif
29+
} // namespace array_cmp_details
30+
31+
template<typename T, typename Compare = std::equal_to<>,
32+
typename U = std::enable_if_t<std::is_array_v<remove_array_ref_t<T>>,
33+
remove_array_ref_t<T>>>
34+
DAW_ATTRIB_FLATTEN constexpr auto
35+
array_cmp( T &&lhs, T &&rhs, Compare const &cmp = Compare{ } ) {
36+
using compare_result_t =
37+
std::invoke_result_t<Compare, std::remove_all_extents_t<U>,
38+
std::remove_all_extents_t<U>>;
39+
for( std::size_t n = 0; n < std::extent_v<U>; ++n ) {
40+
auto r = [&] {
41+
if constexpr( std::rank_v<U> > 1 ) {
42+
return array_cmp( lhs[n], rhs[n], cmp );
43+
} else {
44+
return cmp( lhs[n], rhs[n] );
45+
}
46+
}( );
47+
if( r != array_cmp_details::equal_or_equivalent_v<compare_result_t> ) {
48+
return r;
49+
}
50+
}
51+
return array_cmp_details::equal_or_equivalent_v<compare_result_t>;
52+
}
53+
} // namespace daw

include/daw/compressed_pair.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace daw {
4444
explicit constexpr compressed_pair_elem( std::piecewise_construct_t,
4545
std::tuple<Args...> args,
4646
std::index_sequence<Indexes...> )
47-
: m_value( DAW_FWD2( Args, std::get<Indexes>( args ) )... ) {}
47+
: m_value( DAW_FWD( std::get<Indexes>( args ) )... ) {}
4848

4949
constexpr reference get( ) noexcept {
5050
return m_value;
@@ -76,7 +76,7 @@ namespace daw {
7676
explicit constexpr compressed_pair_elem( std::piecewise_construct_t,
7777
std::tuple<Args...> args,
7878
std::index_sequence<Indexes...> )
79-
: value_type( DAW_FWD2( Args, std::get<Indexes>( args ) )... ) {}
79+
: value_type( DAW_FWD( std::get<Indexes>( args ) )... ) {}
8080

8181
constexpr reference get( ) noexcept {
8282
return *this;
@@ -113,8 +113,8 @@ namespace daw {
113113

114114
template<typename U1, typename U2>
115115
explicit constexpr compressed_pair( U1 &&t1, U2 &&t2 )
116-
: Base1( DAW_FWD2( U1, t1 ) )
117-
, Base2( DAW_FWD2( U2, t2 ) ) {}
116+
: Base1( DAW_FWD( t1 ) )
117+
, Base2( DAW_FWD( t2 ) ) {}
118118

119119
template<class... Args1, class... Args2>
120120
explicit constexpr compressed_pair( std::piecewise_construct_t pc,

0 commit comments

Comments
 (0)