Skip to content

Commit 91b401a

Browse files
committed
Remove local implementation of invoke; use Compat
1 parent 56ba602 commit 91b401a

4 files changed

Lines changed: 22 additions & 58 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Distributed under the Boost Software License, Version 1.0.
33
# https://www.boost.org/LICENSE_1_0.txt
44

5-
cmake_minimum_required(VERSION 3.8...3.20)
5+
cmake_minimum_required(VERSION 3.8...3.31)
66

77
project(boost_system VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
88

@@ -14,6 +14,7 @@ target_include_directories(boost_system INTERFACE include)
1414
target_link_libraries(boost_system
1515
INTERFACE
1616
Boost::assert
17+
Boost::compat
1718
Boost::config
1819
Boost::throw_exception
1920
Boost::variant2

include/boost/system/detail/invoke.hpp

Lines changed: 0 additions & 38 deletions
This file was deleted.

include/boost/system/result.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <boost/system/system_error.hpp>
1010
#include <boost/system/detail/error_code.hpp>
1111
#include <boost/system/detail/error_category_impl.hpp>
12-
#include <boost/system/detail/invoke.hpp>
1312
#include <boost/variant2/variant.hpp>
13+
#include <boost/compat/invoke.hpp>
1414
#include <boost/throw_exception.hpp>
1515
#include <boost/assert/source_location.hpp>
1616
#include <boost/assert.hpp>
@@ -1131,7 +1131,7 @@ result<T, E>& operator|=( result<T, E>& r, F&& f )
11311131
// result & unary-returning-value
11321132

11331133
template<class T, class E, class F,
1134-
class U = detail::invoke_result_t<F, T&>,
1134+
class U = compat::invoke_result_t<F, T&>,
11351135
class En1 = typename std::enable_if<!detail::is_result<U>::value>::type,
11361136
class En2 = typename std::enable_if<!std::is_void<U>::value>::type
11371137
>
@@ -1143,12 +1143,12 @@ result<U, E> operator&( result<T, E>& r, F&& f )
11431143
}
11441144
else
11451145
{
1146-
return detail::invoke( std::forward<F>( f ), *r );
1146+
return compat::invoke( std::forward<F>( f ), *r );
11471147
}
11481148
}
11491149

11501150
template<class T, class E, class F,
1151-
class U = detail::invoke_result_t<F, T const&>,
1151+
class U = compat::invoke_result_t<F, T const&>,
11521152
class En1 = typename std::enable_if<!detail::is_result<U>::value>::type,
11531153
class En2 = typename std::enable_if<!std::is_void<U>::value>::type
11541154
>
@@ -1160,12 +1160,12 @@ result<U, E> operator&( result<T, E> const& r, F&& f )
11601160
}
11611161
else
11621162
{
1163-
return detail::invoke( std::forward<F>( f ), *r );
1163+
return compat::invoke( std::forward<F>( f ), *r );
11641164
}
11651165
}
11661166

11671167
template<class T, class E, class F,
1168-
class U = typename std::decay< detail::invoke_result_t<F, T> >::type,
1168+
class U = typename std::decay< compat::invoke_result_t<F, T> >::type,
11691169
class En1 = typename std::enable_if<!detail::is_result<U>::value>::type,
11701170
class En2 = typename std::enable_if<!std::is_void<U>::value>::type
11711171
>
@@ -1177,12 +1177,12 @@ result<U, E> operator&( result<T, E>&& r, F&& f )
11771177
}
11781178
else
11791179
{
1180-
return detail::invoke( std::forward<F>( f ), *std::move( r ) );
1180+
return compat::invoke( std::forward<F>( f ), *std::move( r ) );
11811181
}
11821182
}
11831183

11841184
template<class T, class E, class F,
1185-
class U = detail::invoke_result_t<F, T&>,
1185+
class U = compat::invoke_result_t<F, T&>,
11861186
class En1 = typename std::enable_if<!detail::is_result<U>::value>::type,
11871187
class En2 = typename std::enable_if<!std::is_void<U>::value>::type
11881188
>
@@ -1194,12 +1194,12 @@ result<U, E> operator&( result<T&, E>&& r, F&& f )
11941194
}
11951195
else
11961196
{
1197-
return detail::invoke( std::forward<F>( f ), *std::move( r ) );
1197+
return compat::invoke( std::forward<F>( f ), *std::move( r ) );
11981198
}
11991199
}
12001200

12011201
template<class T, class E, class F,
1202-
class U = detail::invoke_result_t<F, T const&>,
1202+
class U = compat::invoke_result_t<F, T const&>,
12031203
class En = typename std::enable_if<std::is_void<U>::value>::type
12041204
>
12051205
result<U, E> operator&( result<T, E> const& r, F&& f )
@@ -1210,13 +1210,13 @@ result<U, E> operator&( result<T, E> const& r, F&& f )
12101210
}
12111211
else
12121212
{
1213-
detail::invoke( std::forward<F>( f ), *r );
1213+
compat::invoke( std::forward<F>( f ), *r );
12141214
return {};
12151215
}
12161216
}
12171217

12181218
template<class T, class E, class F,
1219-
class U = detail::invoke_result_t<F, T>,
1219+
class U = compat::invoke_result_t<F, T>,
12201220
class En = typename std::enable_if<std::is_void<U>::value>::type
12211221
>
12221222
result<U, E> operator&( result<T, E>&& r, F&& f )
@@ -1227,7 +1227,7 @@ result<U, E> operator&( result<T, E>&& r, F&& f )
12271227
}
12281228
else
12291229
{
1230-
detail::invoke( std::forward<F>( f ), *std::move( r ) );
1230+
compat::invoke( std::forward<F>( f ), *std::move( r ) );
12311231
return {};
12321232
}
12331233
}
@@ -1269,7 +1269,7 @@ result<U, E> operator&( result<void, E> const& r, F&& f )
12691269
// result & unary-returning-result
12701270

12711271
template<class T, class E, class F,
1272-
class U = typename std::decay< detail::invoke_result_t<F, T&> >::type,
1272+
class U = typename std::decay< compat::invoke_result_t<F, T&> >::type,
12731273
class En1 = typename std::enable_if<detail::is_result<U>::value>::type,
12741274
class En2 = typename std::enable_if<std::is_convertible<E, typename U::error_type>::value>::type
12751275
>
@@ -1281,12 +1281,12 @@ U operator&( result<T, E>& r, F&& f )
12811281
}
12821282
else
12831283
{
1284-
return detail::invoke( std::forward<F>( f ), *r );
1284+
return compat::invoke( std::forward<F>( f ), *r );
12851285
}
12861286
}
12871287

12881288
template<class T, class E, class F,
1289-
class U = typename std::decay< detail::invoke_result_t<F, T const&> >::type,
1289+
class U = typename std::decay< compat::invoke_result_t<F, T const&> >::type,
12901290
class En1 = typename std::enable_if<detail::is_result<U>::value>::type,
12911291
class En2 = typename std::enable_if<std::is_convertible<E, typename U::error_type>::value>::type
12921292
>
@@ -1298,12 +1298,12 @@ U operator&( result<T, E> const& r, F&& f )
12981298
}
12991299
else
13001300
{
1301-
return detail::invoke( std::forward<F>( f ), *r );
1301+
return compat::invoke( std::forward<F>( f ), *r );
13021302
}
13031303
}
13041304

13051305
template<class T, class E, class F,
1306-
class U = typename std::decay< detail::invoke_result_t<F, T> >::type,
1306+
class U = typename std::decay< compat::invoke_result_t<F, T> >::type,
13071307
class En1 = typename std::enable_if<detail::is_result<U>::value>::type,
13081308
class En2 = typename std::enable_if<std::is_convertible<E, typename U::error_type>::value>::type
13091309
>
@@ -1315,7 +1315,7 @@ U operator&( result<T, E>&& r, F&& f )
13151315
}
13161316
else
13171317
{
1318-
return detail::invoke( std::forward<F>( f ), *std::move( r ) );
1318+
return compat::invoke( std::forward<F>( f ), *std::move( r ) );
13191319
}
13201320
}
13211321

test/cmake_subdir_test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ project(cmake_subdir_test LANGUAGES CXX)
88

99
add_subdirectory(../.. boostorg/system)
1010
add_subdirectory(../../../assert boostorg/assert)
11+
add_subdirectory(../../../config boostorg/compat)
1112
add_subdirectory(../../../config boostorg/config)
1213
add_subdirectory(../../../core boostorg/core)
1314
add_subdirectory(../../../mp11 boostorg/mp11)

0 commit comments

Comments
 (0)